bookmarklet.one

Dark Mode on Any Website: The One-Click Bookmarklet

Plenty of sites still ship only a bright white theme. At night, or on a large monitor, that glare is tiring. The Dark Mode Toggle bookmarklet flips any page to a dark theme with one click, and a second click switches it back. There is no extension, no account, and no per-site setup.

Dark Mode Toggle
Dark Mode Toggle bookmarklet

Free Dark Mode Toggle bookmarklet: switch any website to dark mode in one click and back again, with photos and videos…

How it works

Writing a dark stylesheet for every website on earth is impossible, so the bookmarklet uses a trick built into CSS: the filter property. It adds a small style element to the page along these lines:

html {
  filter: invert(1) hue-rotate(180deg);
  background: #fff;
}
img, picture, video, canvas, iframe, svg image, [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg);
}

Here is what each part does:

  • invert(1) flips every color to its opposite. White backgrounds become black, and black text becomes white.
  • hue-rotate(180deg) fixes the side effect. Inverting also turns blue into orange and green into magenta. Rotating the hue halfway around the color wheel brings hues back close to the originals, so links stay blue-ish and brand colors stay recognizable. Lightness stays inverted.
  • Re-inverting media. Photos and videos would look like film negatives, so the same filter is applied to them a second time. Two inversions cancel out, and images render normally inside the dark page.
  • The background fallback. Some pages have no background color set at all, so the browser's default white shows through. Setting it explicitly ensures there is something to invert.

Because the bookmarklet only adds one style element with a known id, turning it off simply removes that element. The page is never reloaded and nothing about the site is permanently changed.

What to expect

On text-heavy sites, such as documentation, news, Wikipedia, forums, and admin panels, the result usually looks like a native dark theme. A few things behave differently:

  • Pure black and white become exact opposites. Because inversion is mathematical, a #fff background becomes #000. Native dark themes often use softer grays. If true black feels harsh, lower your screen brightness a notch.
  • CSS background images. Hero images set as backgrounds, not <img> tags, can end up inverted when the bookmarklet cannot detect them. Logos drawn with CSS gradients can look odd for the same reason.
  • Already-dark sites get brighter. Running it on a site that is already dark turns it light. That is the toggle working as designed. Click again to undo.
  • Shadows turn into glows. A dark drop shadow becomes a light halo. It is usually subtle, but you may notice it on cards and menus.
  • Heavy pages may scroll less smoothly. A filter on the whole page makes the browser do extra compositing work. On most machines you will not notice, but very long, image-heavy pages can feel a little slower.

When dark mode does not stick

The effect lasts until you reload or navigate to another page, because a bookmarklet cannot run automatically on the next page load. On single-page apps like Gmail or Notion, where clicking around does not trigger a real page load, it usually stays on as you move through the app.

If the bookmarklet does nothing at all, check that you are not on a browser-internal page, like the new tab page or settings, where no bookmarklet can run. Our troubleshooting guide covers other causes.

Better options in some cases

A filter-based toggle is the most universal approach, but it is not the only one.

The site's own dark theme

Many sites now follow your operating system's preference through the prefers-color-scheme media query. Turn on dark mode in Windows, macOS, iOS, or Android, and sites that support it switch automatically with properly designed colors. Always try that first.

Reader mode

If what you really want is a calm page to read, a reader view is often better than inverting a cluttered layout. Our Reader Mode bookmarklet extracts the article into a clean, simple layout, and you can run Dark Mode Toggle on top of it.

Reader Mode
Reader Mode bookmarklet

Free Reader Mode bookmarklet: opens a clean reading view of any article without ads or sidebars. Adjust text size, choose…

Removing colors entirely

For pages with garish color schemes, stripping colors can be easier on the eyes than inverting them.

Remove Colors
Remove Colors bookmarklet

Strip all colors, backgrounds and shadows from a web page and read it as plain black text on white. Click again to…

Browser settings and extensions

Chrome has an experimental flag at chrome://flags/#enable-force-dark ("Auto Dark Mode for Web Contents") that darkens every site. It is powerful, but it is global and flags can change or disappear between releases. Extensions like Dark Reader generate a real dark stylesheet per site and remember your choices, at the cost of needing permission to read every page you visit. If you want dark mode on every site, every time, an extension is the right tool. If you want it occasionally, on your terms, the bookmarklet is lighter.

Is forced dark mode better for your eyes?

It depends on the setting. In a dim room, a dark page reduces glare and the contrast between your screen and your surroundings, which many people find more comfortable. In bright daylight, dark text on a light background is often easier to read, especially for people with astigmatism, who may see light text on dark backgrounds as slightly blurry. Use the toggle when it helps, and turn it off when it does not. That is the advantage of a one-click switch.

Tips for designers and developers

The toggle is also a quick test tool. If you are building a native dark theme, run the bookmarklet on your light design to get a rough preview of which areas will need attention, such as images with white backgrounds, borders that disappear, and focus rings that lose contrast.

And if you ship your own dark mode, respect prefers-color-scheme and declare color-scheme: light dark in your CSS so form controls and scrollbars match. Visitors will then rarely need a bookmarklet on your site.

Pairs well with: Sticky Header Killer to clear floating bars, and Read Aloud to give your eyes a break altogether.

Frequently asked questions

Does the dark mode bookmarklet change the website permanently?

No. It adds a temporary style to the page in your browser only. Click it again, or reload the page, and the original colors return.

Why do some images look strange in dark mode?

Images are re-inverted so they look normal, but images set as CSS backgrounds are not always detectable and can stay inverted. Logos with transparent backgrounds can also look different.

Can I make dark mode stay on for every page?

Not with a bookmarklet, because it cannot run automatically on page load. Use your operating system dark mode for supporting sites, or a dark mode extension if you want it everywhere.

Does it work on mobile?

Yes, if you install it using the mobile steps in our installation guide. Mobile browsers also offer their own dark mode settings, which are worth checking first.