Design and Social Media

How to Make a Before and After Slider for Your Website

Shoot matching before and after photos, align them precisely and publish an interactive comparison slider, an animated GIF or a side-by-side image.

Saizul Amin
Saizul Amin2 Nov 2026 · 4 min read
How to Make a Before and After Slider for Your Website

How to Make a Before and After Slider for Your Website

A before and after comparison is one of the most persuasive images a business can publish. Builders, cleaners, photo retouchers, landscapers, dentists and web designers all rely on it, because it shows the change instead of describing it. The interactive version, where visitors drag a divider across the picture, keeps people on the page longer than two static photos. This guide covers how to shoot photos that compare well, how to line them up, and how to publish the result with the free Before and After Slider Maker.

Shooting photos that match

Most comparison problems start at the camera. The goal is for the two photos to differ only in the thing that changed. Stand in exactly the same place for both shots; mark the spot with tape on the floor or note a landmark. Keep the same height, ideally by using a tripod or resting the phone on the same surface. Use the same lens setting, which on a phone means the same zoom button, because switching between the wide and main camera changes the perspective. Shoot at a similar time of day so the light falls the same way, and keep doors, curtains and lamps as they were if they are not part of the change.

When you return weeks later for the after photo, open the before photo on your phone and hold it up for reference. Small differences are fine; they can be corrected in alignment.

Aligning the two photos

Even careful photographers end up a few centimetres off. The maker treats the before photo as the frame and lets you move, scale and rotate the after photo on top of it. Two views help. Onion skin shows the after photo semi-transparent, so you can see doubled edges and drag until they merge. Difference view subtracts one photo from the other: areas that line up turn black and misaligned edges glow, which reveals tiny shifts the eye would miss.

A good order is to fix rotation first using a long straight line such as a worktop or roof edge, then scale using two features far apart, then position. Use arrow keys for the final pixel moves. Focus your alignment on the parts that did not change, such as window frames and walls, because those are what the viewer uses to judge whether the comparison is fair.

Choosing direction and labels

A vertical divider suits most interiors, faces and products, since people naturally scan left to right and read the left side as before. A horizontal divider works for tall subjects, gardens seen from above, or a sky replacement. Keep labels short; Before and After are clear, but specific words like Original and Retouched or 2019 and 2025 can add meaning. Pick a divider colour that stands out against both photos; white with a soft shadow is a safe default.

Publishing the interactive slider

The HTML export is a single self-contained file. Both images are stored inside it, together with a few lines of script that let visitors drag the divider with a mouse, finger or pen and move it with the arrow keys. Because nothing is loaded from elsewhere, it keeps working even if you move it between servers. On most website builders you upload the file to your media library or hosting and show it in an iframe block. You can also open it directly from a laptop at a client meeting without internet.

Accessibility matters for comparison widgets. The divider in the export can be focused with the keyboard and announces its position to screen readers, and the images have the label text as their description.

When to use the GIF or side-by-side image

Social networks and email clients do not run scripts, so the interactive version will not work there. An animated GIF of the divider sweeping across is the next best thing: it plays automatically in feeds and messaging apps. Keep it short, around 24 frames at 640 pixels wide, to stay within upload limits. For print, proposals and marketplaces that only accept still images, the side-by-side PNG shows both aligned photos next to each other with labels.

Honest comparisons

A comparison only persuades if viewers trust it. Do not brighten the after photo more than the before, and avoid changing the crop between them. If you retouched the after photo, say so. Alignment in this tool only moves, scales and rotates; it does not warp the picture, so the result stays a fair representation of what the camera saw.

Quick workflow

Shoot both photos from the same position. Load the before photo, then the after photo. Align with onion skin and difference views. Pick the divider direction, start position, colour and labels. Export the HTML file for your website, the GIF for social media and the side-by-side PNG for documents. Everything runs in your browser, so client photos stay on your own device.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages