HTML Animation to Video Converter — Pixab AI
Record HTML, CSS and JavaScript animations as WebM video files in your browser. Paste your code, set duration and FPS, and download the result. 100% private — nothing uploaded.
Note: This tool executes the HTML/JS you paste in a sandboxed iframe. Only convert code you trust. All processing runs locally — nothing is uploaded to any server.
Preview shows your animation live. Click Record to capture it as video.
How it works
- 1Paste your self-contained HTML animation code into the editor (CSS and JS included).
- 2Choose your video dimensions, duration, and frame rate from the dropdowns.
- 3Click "Record Animation" — your animation will run and be captured frame-by-frame.
- 4Watch the progress bar until recording completes, then preview and download the WebM video.
Frequently asked questions
What Is an HTML Animation Video Exporter?
An HTML animation video exporter captures web-based animations — built with CSS keyframes, JavaScript, Canvas, SVG, or libraries like GSAP and Three.js — and encodes them as a downloadable video file. Instead of using screen-recording software, this tool automates the capture process directly in the browser: no plugins, no desktop apps, no uploads.
The workflow is simple: paste your self-contained HTML animation code, choose your resolution and duration, hit Record, and download a WebM video file. Everything runs client-side in a sandboxed iframe — your code never leaves your device.
Supported Animation Types
This tool can capture any visual animation that renders in the browser:
- CSS animations and transitions —
@keyframes, transitions, transforms, gradients, and anything achievable in pure CSS. - JavaScript DOM animations —
requestAnimationFrameloops, style mutations, and programmatic DOM updates. - Canvas 2D animations — particle systems, generative art, physics simulations, and anything drawn on a
<canvas>element. - SVG animations — animated SVG paths, SMIL animations, and SVG combined with JavaScript.
- Third-party library animations — GSAP timelines, Anime.js, Lottie, p5.js sketches, and similar libraries work as long as you include them via CDN in your HTML.
How the Recording Works
The tool uses a two-stage pipeline:
- Frame capture inside the iframe. Your animation runs in a sandboxed iframe. The open-source html2canvas library (loaded from jsDelivr CDN) renders the animation frame-by-frame into a canvas element, then posts each frame as a JPEG data URL back to the parent page.
- Video encoding in the parent page. Each received frame is drawn to a hidden canvas. The browser's built-in
MediaRecorderAPI captures the canvas stream and encodes it as a VP9 WebM video in real time. When the target duration is reached, the recording stops and the video is made available for download.
The entire process is client-side. No frames or video data are transmitted to any server.
Tips for Best Results
Use a self-contained HTML file. Include all CSS in <style> tags and all scripts in <script> tags or via CDN URLs. Relative file references (to local images or fonts) will not work in the sandboxed preview.
Set a matching viewport size. Design your animation for the same resolution you select in the Dimensions dropdown. Animations built for a 1280×720 canvas will look their best when recorded at 1280×720.
Lower FPS for complex animations. html2canvas takes time to render each frame. For animations with many elements, choosing 15 fps instead of 30 gives html2canvas more time per frame, resulting in smoother-looking output.
Canvas-based animations record best. If your animation uses a <canvas> element directly (not CSS/DOM), it records with perfect fidelity because html2canvas can extract the pixel data directly from the canvas.
Avoid external resources that block CORS. Fonts and images loaded from third-party servers may not render correctly due to Cross-Origin Resource Sharing (CORS) policies. Use inline SVG, Base64-encoded images, or CDN resources that explicitly allow cross-origin access.
Output Format: WebM
The video is exported as WebM with VP9 encoding — a modern, open format supported natively in Chrome, Firefox, Edge, and Opera. If you need an MP4 for use in iOS, iMessage, or older software, you can convert the WebM to MP4 using a tool like FFmpeg (ffmpeg -i animation.webm animation.mp4) or an online converter.
VP9 at 5 Mbps provides excellent visual quality for most animations. For lossless output of simple line/shape animations, lower bitrates (1–2 Mbps) are sufficient.
Frequently Asked Questions
Why does my animation look choppy in the video?
html2canvas renders each frame synchronously by "painting" the DOM. For complex pages with many elements, this can take 200–500ms per frame. If your animation plays faster than html2canvas can capture, you'll see duplicate or dropped frames. Solutions: reduce the complexity of your animation, lower the target FPS, or simplify the DOM structure.
My animation uses a WebGL canvas — will it work?
html2canvas does not support WebGL contexts. For WebGL animations (Three.js, Babylon.js, raw WebGL), html2canvas cannot read the GPU framebuffer. A workaround is to use your WebGL library's own renderer.domElement.toDataURL() method to export frames directly from the WebGL canvas, then send them via postMessage to the parent. This requires modifying your animation code slightly.
Can I record animated GIFs instead of video?
This tool outputs WebM video. To convert to GIF, run the downloaded WebM through FFmpeg: ffmpeg -i animation.webm -vf "fps=15,scale=640:-1" output.gif. Note that GIF is limited to 256 colors and large file sizes — WebM is almost always a better choice for web use.
Does this work offline?
The capture engine (html2canvas) is loaded from the jsDelivr CDN when you press Record, so an internet connection is required at that moment. After the library loads, the actual frame capture and video encoding are fully offline.
Is my animation code stored anywhere?
No. Your code runs in a sandboxed iframe in your browser and is never transmitted to any server. Nothing is stored between sessions — refreshing the page clears the editor.
Keep going
Related Tools
SVG to PNG/JPG Converter
Convert SVG vector files to PNG, JPG or WebP at any resolution
CSS Box Shadow Generator
Visually create CSS box shadows with live preview and multi-layer support
CSS Gradient Generator
Create beautiful CSS gradients with live preview and one-click copy
Base64 Encoder / Decoder
Encode text or files to Base64 and decode Base64 strings instantly
Image to Base64 Converter
Convert any image to a Base64 data URI for embedding in HTML, CSS, or code
UUID Generator
Generate UUID v1, v4 and v7 identifiers in bulk with multiple formats
URL Encoder / Decoder
Encode and decode URLs, and parse URL components including query parameters
HTML Entity Encoder / Decoder
Encode and decode HTML entities, plus a complete entity reference table