Why invert PDF colors?
Reading white-background PDFs for hours strains your eyes — especially at night or in low-light. Most PDF viewers have a "night mode" display toggle, but that only changes how the file looks on that device. Share the file, open it on another computer, or print it, and it snaps back to blinding white. The only way to make dark mode permanent is to modify the PDF file itself.
ihatepdf's inverter does exactly that — it reaches into the PDF's content streams and rewrites the color operators that draw every text character, shape, and line. The result is a new PDF where dark mode is the actual content, not a display-layer overlay.
How to invert PDF colors free online
- Open ihatepdf.cv/invert-pdf — no sign-up required
- Drop your PDF onto the upload area or click to browse
- Select a color mode: Dark Mode, Full Invert, Sepia, or Grayscale
- Click Apply & Download
- The converted PDF downloads automatically — text is still selectable and searchable
Everything runs in your browser using WebAssembly. Your PDF never leaves your device.
The four color modes — what each one does
- Dark Mode — fills the page with a dark background (
#111827) and inverts all existing colors. RGB white becomes black, black becomes white, and every intermediate color is flipped to its inverse. The best choice for extended reading sessions, code documentation, and night use. Equivalent to what e-readers call "night mode" — but permanently baked into the PDF file - Full Invert — pure RGB inversion with a near-black background. White becomes black, black becomes white, blue becomes yellow, red becomes cyan. Creates the classic photo-negative effect with absolute maximum contrast. Useful for PDFs you want to give an ink-on-dark aesthetic
- Sepia — replaces the white background with a warm cream tone
(
#fdf4e3) and shifts text and shapes to brown tones. Reduces blue light exposure while keeping the page bright enough for comfortable daytime reading. Popular for ebooks, long-form articles, and any PDF you want to feel like a printed book - Grayscale — converts all colors to luminance-accurate grey values using the standard luminance formula (0.299R + 0.587G + 0.114B), which matches how the human eye perceives brightness. Ideal before black-and-white printing to preview exactly how colors will translate to greyscale ink — no test prints wasted
How is this different from PDF viewer night mode?
PDF viewer night modes in Adobe Reader, Chrome, Edge, or macOS Preview apply a CSS or display-pipeline filter to your screen. The underlying file is completely untouched. The moment you share it, email it, print it, or open it in a different viewer, it reverts to white.
ihatepdf's inverter decompresses each page's content stream (using pako/FlateDecode),
rewrites the PDF color operators — rg/RG for RGB fill and stroke,
g/G for grayscale, k/K for CMYK — then
recompresses and saves a new PDF. The dark colors are now the actual drawing instructions
for every page. Every PDF viewer on every device will display them identically.
Does text stay selectable after inversion?
Yes — and this is the critical technical distinction. The naive approach to PDF inversion renders each page as a raster image and inverts the image pixels. That looks correct on screen but destroys the text layer entirely: you can't select, copy, search, or highlight anything in the output. Screen readers can't read it. PDF search tools can't index it.
Because the inverter transforms color operators directly in the content streams without touching the text layer, all of this works exactly as in the original: text selection, copy-paste, browser PDF search (Ctrl+F), screen reader access, and PDF annotation tools.
Which PDF color spaces are supported?
The inverter handles all four standard PDF color operator pairs:
- RGB —
rg(fill) andRG(stroke). The most common color space in modern PDFs - Grayscale —
g(fill) andG(stroke). Used in text-only PDFs and black-and-white documents - CMYK —
k(fill) andK(stroke). Common in print-production PDFs. CMYK values are converted to RGB for transformation, then converted back to CMYK so the output stays in the original color space
Streams using unsupported filters (anything other than FlateDecode) are left unchanged and a warning is shown — the rest of the PDF still processes normally.
What kinds of PDFs benefit most?
- Research papers and academic PDFs — long reading sessions on white backgrounds cause significant eye fatigue. Dark mode makes hours of reading far more comfortable
- Technical documentation and developer docs — code snippets in monospaced fonts look excellent on a dark background, matching the IDE color themes most developers use daily
- Ebooks and long-form PDFs — convert a white-background ebook to dark mode or sepia for night reading without switching apps or using a dedicated e-reader
- Presentation PDFs — convert a light-themed slide deck to dark for projector-friendly display or video call screen sharing where bright white slides wash out
- Print preparation — convert to grayscale before printing to preview exactly how a color PDF will look in black-and-white without wasting test pages
Frequently asked questions
Will embedded images be inverted?
The tool transforms vector color operators in PDF content streams. Raster images (JPEGs, PNGs) embedded in the PDF are not affected — they retain their original colors. Text, vector shapes, lines, and any graphics drawn with PDF color operators are fully transformed.
Can I invert the PDF back to the original?
For Dark Mode and Full Invert, running the inverted PDF through the tool again recovers the original colors — RGB inversion applied twice cancels out. For Sepia and Grayscale, the original color data is not recoverable from the output. Always keep a copy of the original PDF.
Is there a page limit?
No artificial limit. Processing time scales with page count — a 100-page document takes roughly 10–30 seconds depending on your device. Progress is shown page-by-page.
Does the output PDF have a watermark?
No. ihatepdf never adds watermarks to any output file.
Are my files uploaded to a server?
No. The entire process — stream decompression, color transformation, recompression, and PDF generation — runs locally in your browser. Your PDF never leaves your device.