bookmarklet.one

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 kept in natural colors.

Dark Mode Toggle
← Drag this button to your bookmarks bar.Click it here to try it on this page first.

On a phone? Use Copy code, then save it as a bookmark's URL — step-by-step guide.

Productivity Accessibility CSS FeaturedUpdated 2026-11-27Free · No extension · Runs locally

The Dark Mode Toggle bookmarklet flips any bright web page to a dark theme instantly, which is a relief at night or on a glaring monitor. Click once to go dark, click again to return to the original design.

It works with a smart CSS filter: the whole page is inverted and hue-rotated by 180 degrees, so white backgrounds become near-black while blues stay blue and reds stay red instead of turning into their opposites. Images, videos, canvases, embedded iframes and elements with background images get the filter applied a second time, which cancels it out, so photos, logos and maps keep their real colors.

Unlike dark mode extensions, nothing is installed, nothing reads your browsing, and it only affects the tab you click it in. It is useful for long documentation sessions, old websites that never got a dark theme, and checking how a design holds up with inverted contrast.

What it does

  • Applies invert(1) hue-rotate(180deg) to the whole page via one injected style tag
  • Re-inverts img, video, canvas, iframe, SVG images and inline background-image elements so media looks normal
  • Sets a white base background first so transparent pages turn properly dark
  • Toggles off cleanly on the second click by removing its style tag
  • Shows a short "Dark mode on/off" toast

How to install the Dark Mode Toggle bookmarklet

  1. Show your bookmarks bar. Press Ctrl+Shift+B on Windows/Linux or Cmd+Shift+B on a Mac (Chrome, Edge, Brave, Firefox). In Safari choose View › Show Favorites Bar.
  2. Drag the blue button above onto the bar. That's it — the bookmark now holds the code.
  3. Open any website and click the bookmark to run it on that page. Click it again to close it.

Can't drag (phone, tablet, locked-down browser)? Copy the code below, create any bookmark, then edit it and paste the code as its URL. See how to add a bookmarklet in every browser.

How to use it

  1. Open a bright page you want to read in dark mode.
  2. Click Dark Mode Toggle in your bookmarks bar.
  3. Read as usual; photos and videos keep their original colors.
  4. Click the bookmarklet again to switch back. Reloading the page also resets it.

Limitations

Because it is a filter rather than a hand-made theme, a few things can look off: images set as CSS background on a class (not inline) are inverted, and pages that are already dark become light. Shadows may look like glows. The setting does not persist across page loads, which is deliberate: there is no storage and no script running in the background. For a gentler effect on very bright sites, combine it with Reader Mode, which has its own dark theme with tuned colors. Because the filter is applied by the browser's graphics engine, scrolling stays smooth even on long pages.

Bookmarklet code

This is the exact code inside the button above (1,511 characters). It runs only in your browser and sends nothing to us. Paste it into the Bookmarklet Decoder to read it formatted.

Frequently asked questions

Will it change images and videos?

No. Images, videos, canvases and iframes are inverted back, so they display in their original colors.

How do I turn dark mode off?

Click the bookmarklet again, or reload the page.

Does it stay on when I open another page?

No. Bookmarklets run on one page at a time, so click it again on the next page.

Related bookmarklets

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

Free Remove Images bookmarklet: hides every image, picture, SVG image and CSS background for distraction-free reading.…

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

Free Sticky Header Killer bookmarklet: unsticks fixed headers, hides cookie banners and overlays, and re-enables…