Published on

Google Docs Dark Mode

Authors
  • avatar
    Name
    Winston Brown
    Twitter

If you’ve ever found yourself writing in Google Docs at 2AM with a white screen burning into your retinas, you're not alone.

Google Docs doesn’t have a built-in dark mode on desktop (as of this writing), but you can simulate one with a nifty little trick: a bookmarklet—a small snippet of JavaScript saved as a browser bookmark. When you click it, it runs a script that inverts the page colors and applies a hue rotation, giving you a soft dark mode experience.

Let’s walk through how to install this in Google Chrome. Once it’s set up, you can toggle it on and off with a click.


What You’ll Be Creating

You’re going to create a bookmark that runs this JavaScript:

javascript:(function(){
  if (window.darkModeEnabled) {
    document.documentElement.style.removeProperty('filter');
    window.darkModeEnabled = false;
  } else {
    document.documentElement.style.setProperty('filter', 'invert(90%) hue-rotate(180deg)', 'important');
    window.darkModeEnabled = true;
  }
})();

This bookmarklet works by toggling a CSS filter on the entire page. It uses:

  • invert(90%): flips most light colors to dark
  • hue-rotate(180deg): helps re-balance colors that might look off after inversion

It also remembers whether it’s already been applied, so clicking it again will turn dark mode off.


Why Use a Bookmarklet Instead of an Extension?

  • No installation required
  • Doesn’t affect browser performance
  • Works on any site, not just Google Docs
  • You stay in control—toggle it only when needed

Step-by-Step: Add the Dark Mode Bookmarklet

1. Open Chrome’s Bookmarks Bar

If it’s not visible, press:

Ctrl + Shift + B (Windows)
Cmd + Shift + B (Mac)

2. Create a New Bookmark

Right-click the Bookmarks Bar and select “Add Page…”

Add Page

3. Name and Paste the Code

  • Name: Toggle Dark Mode (or anything you want)
  • URL: Paste in the JavaScript from above.
Edit Bookmark

Click Save.


How to Use It

  1. Go to Google Docs.
  2. Open a document.
  3. Click your Toggle Dark Mode bookmark.
  4. Watch the page go dark. Click it again to go back.
Dark Mode

Known Limitations

  • Images and embedded content may also get color-inverted, which could look odd.
  • Some fonts or menus might appear slightly off-color depending on your monitor or OS settings.

Bonus: Works on More Than Google Docs

This trick works on almost any website—news sites, dashboards, even your favorite blog (ahem). It's a lightweight way to save your eyes when extensions aren’t an option.


TL;DR

Want dark mode in Google Docs without installing anything? Add this JavaScript as a bookmark:

javascript:(function(){
  if (window.darkModeEnabled) {
    document.documentElement.style.removeProperty('filter');
    window.darkModeEnabled = false;
  } else {
    document.documentElement.style.setProperty('filter', 'invert(90%) hue-rotate(180deg)', 'important');
    window.darkModeEnabled = true;
  }
})();

Click it anytime to toggle dark mode on/off.