This free before and after image slider maker turns two photos into an interactive comparison: drag the handle across and one image wipes over the other. Add a before and an after image, and the tool lines them up in one frame even if they are different sizes, such as an upscaled copy at 4× or an edit cropped by a few pixels. Choose a left/right or top/bottom split, edit the Before and After labels, pick a handle colour, and test the slider right on the page with a mouse, a finger or the arrow keys.
Then take it wherever you need it. Copy an embed code that works in WordPress, Webflow, Ghost or any page that accepts HTML: it is a single block with its own small script, no plugin or library, and the images go inside the code or load from URLs you host. For social posts and documents, download a side-by-side or stacked still image, or an animated sweep as a GIF (works everywhere) or MP4 (in Chrome, Edge and Safari). Everything happens in your browser; nothing is uploaded.
How to use
- Choose the before image and the after image (or drop them on the two boxes). Sample photos are shown until you add your own.
- Check the alignment: keep Fill and crop for photos of the same scene, or switch to Fit inside if one image must not be trimmed. Pick which image sets the frame size and the longest side.
- Set the direction, the labels and the handle colour, and try the slider on the preview.
- Open Embed code, add alt text, and click Generate embed code; copy it into an HTML block on your site. Or open Still image or GIF / video to download a file instead.
Frequently asked questions
How do I add a before and after slider to my website?
Make the slider here, open the Embed code tab and click Generate embed code, then paste the code into an HTML block: Custom HTML in WordPress, an Embed element in Webflow, an HTML card in Ghost, or straight into a page template. The code is one div with a scoped style and a small script; it needs no plugin, library or account, and works with several sliders on the same page.
Should I put the images inside the embed code or use URLs?
Inside the code (data URIs) is the easiest: one paste and it works, with no files to host. The cost is size: base64 makes the images about a third larger, the page has to download them on every view without caching, and some site builders reject very long code blocks, so the tool warns above 1.5 MB. For a large or frequently viewed page, upload the two images to your site or CDN at the same size and choose My own image URLs.
What if my two photos are different sizes?
The tool draws both into one frame before you compare them. Fill and crop scales each image to cover the frame and trims the overflow equally on both sides, which is right for two shots of the same scene. Fit inside keeps the whole image and adds black bars, and Stretch fills exactly but distorts. You choose whether the frame takes the size of the before image, the after image, the smaller or the larger one, capped at a longest side from 800 to 2400 pixels. For a perfect match the photos should be taken from the same spot; the tool aligns sizes, not camera angles.
Is the slider accessible and does it work on phones?
Yes. The handle is a real slider control with a label, so screen readers announce it and keyboard users can move it with the arrow keys, Page Up/Down and Home/End. Pointer events handle mouse, pen and touch the same way, and on a phone a left/right slider still lets the page scroll vertically, so it does not trap the reader. Both images carry the alt text you enter.
Can I make a before and after GIF or video for Instagram?
Yes. The GIF / video tab records the handle sweeping from the middle to each side and back, and the animation loops. GIF works in every browser and every app but is limited to 256 colours and gets large, so keep it at 400 to 800 pixels wide. MP4 is sharper and much smaller; it is offered when your browser can record MP4 from a canvas (current Chrome, Edge and Safari). Firefox cannot, and there the MP4 button is hidden with a note.
Where before and after sliders work best
• Photo editing and retouching: show the raw shot against the edit. Pair with the background remover or the AI upscaler to make the after image.
• Renovation, cleaning, landscaping and detailing: one slider replaces two photos side by side and shows the change at the same scale.
• Product and image-quality comparisons: compression levels, image formats, camera settings, or an old and a new version of a design.
• Maps and long-term change: two aerial or satellite images of the same place, years apart.
Two rules make a comparison convincing: shoot both from the same position with the same framing, and keep exposure and white balance consistent unless they are what you are comparing. A slider exaggerates every shift of the camera, because the eye follows the edge.
How the embed code works
The after image is the base layer and the before image sits on top, cut to the handle position with the CSS clip-path property. Both images stay the same size and position at all times, so nothing jumps or rescales while dragging; this is the main difference from sliders that animate an element's width.
The script is under 1.5 KB and only listens to pointer and keyboard events on its own element. It sets the slider's ARIA value as it moves, uses touch-action so phones can still scroll, and is scoped to a random id, so two sliders on one page do not interfere. The images are the only external requests, and only if you choose URLs.
Still image, GIF or MP4: which to use
• Side-by-side or stacked still (PNG or JPG): for documents, slides, reports and marketplaces that do not allow animation. PNG is lossless; JPG is smaller for photos.
• GIF: plays automatically everywhere, including email and chat apps, but has 256 colours and no real compression, so a 4-second 600-pixel sweep is often 2 to 6 MB.
• MP4: smooth, full colour and usually a fraction of the GIF's size; the best choice for Instagram, LinkedIn and other social posts. Recording happens in real time, so keep the tab visible while it runs.
