Invert PDF Colors

Turn a PDF into its own negative — white pages become black, black text becomes white.

About inverting the colours of a PDF

This tool draws every page of your document with the same renderer a browser uses to display PDFs, flips every pixel to its opposite, and assembles the results into a new file called inverted-yourfile.pdf. A page of black text on white paper comes back as white text on black. Everything happens in this tab — the pdf.js worker is served from this site, and your document is never sent anywhere.

What inversion actually is

Each pixel holds three numbers between 0 and 255 for red, green and blue. Inverting replaces each with 255 minus itself. That single operation produces the familiar photographic negative: pure white (255, 255, 255) becomes pure black, pure black becomes pure white, and every colour lands on its complement — red becomes cyan, green becomes magenta, blue becomes yellow. Mid-grey stays where it is. It is not a theme, a stylesheet or a smart dark mode; there is no attempt to keep photographs looking natural or to preserve brand colours, so an inverted page containing a portrait will contain a negative of that portrait.

The trade you are making

There is no way to invert a PDF's colours without rasterising it. Text in a PDF is drawn by referencing a font and a fill colour, and while a handful of those colour operators could in principle be rewritten, the same page will also contain images, shading patterns, transparency groups and vector art whose colours live in a dozen other places. Rendering the page and flipping the pixels is the only approach that treats all of it consistently. The consequence is that the output pages are pictures. Text selection, search, copy and paste, links, bookmarks, form fields and screen-reader access all stop working, and the file typically grows — on a text-heavy document, where the original is compact precisely because it is not a picture, the inverted copy can easily be tens of times larger.

Before converting, it is worth checking whether your reader can do this without touching the file. Acrobat has an accessibility setting that replaces document colours, macOS Preview and several mobile readers offer a night mode, and browser extensions do the same for PDFs opened on the web. Those are all display-time effects: reversible, free, and they leave the text intact. Converting is the right answer when the dark version has to be the artefact — something you hand to someone else, print, or open in software with no such setting.

Choosing a resolution

A PDF point is one seventy-second of an inch, so the render scale is exactly the DPI divided by 72. The three settings are 1x (72 DPI), 2x (144 DPI) and 3x (216 DPI); on an A4 page that is roughly 595 by 842, 1191 by 1684 and 1786 by 2526 pixels. Two is the sensible default for reading on a screen, including a high-density display. One is for a quick look or when the document is enormous. Three is for printing, or for a scanned original that was captured at high resolution and would visibly soften at anything less. Any page whose canvas would exceed about 26 megapixels, or 32,767 pixels along either edge — a poster, a large engineering drawing, an unusually long strip — is rendered at a lower scale, because browsers return an empty canvas rather than an error when either limit is crossed. The setting is therefore a ceiling rather than a promise, and the result line tells you when a page fell short of it and by how much.

PNG or JPEG inside the file

PNG stores the rendered page exactly. On documents made of type and line art that is both the sharper and the more compact choice, because lossless compression is very efficient on the large flat areas a page is mostly made of — and inversion makes those areas flat black, which costs almost nothing. On three different text documents at the default quality, PNG was the smaller file at 72, 144 and 216 DPI alike, by twenty to forty per cent. JPEG throws away detail the eye is least likely to miss and is dramatically smaller on scans, photographs and dense vector art — on a photographic document it came out roughly twenty-five times smaller than PNG at 72 DPI, and about seven times smaller at 216 — at the cost of faint ringing around hard edges, which on inverted text means a soft grey halo around white letters. Choose by what the pages contain rather than by how many there are, and treat every one of those margins as a rough guide: they move a long way from document to document, which is why the result line reports the real size each time. The quality slider runs from 30 to 100 and 85 is a good default. Pushing it to 95 cost about 1.8 times a 70 on the text documents measured here and about five and a half times on the photographic one; and on type a 95 landed at roughly twice the size of the lossless PNG, so if you find yourself reaching that high on a page of text, PNG is the better trade in both directions.

What is preserved, and what is not

Page dimensions are kept exactly: each output page is created at the source page's displayed size in points and the image is stretched to fill it, so an A4 stays A4 and a document with mixed page sizes keeps them. Pages flagged with a rotation are rendered the way a reader shows them and written out upright. Everything else is discarded, because the output is a new document built from images — no metadata, no outline, no attachments, no annotation objects, no encryption. The file is written without an information dictionary at all, so it does not even carry the producer name or creation timestamp a PDF library would normally stamp on it. Annotations the renderer paints onto the page, such as highlights and filled form values, become part of the picture. If your real goal is to strip structure rather than to change colours, Remove PDF Metadata and Flatten PDF do that without rasterising; if you want the pages as standalone images instead of a PDF, PDF to PNG is the direct route.

A true channel-by-channel negative

Every page is rendered to a canvas and each red, green and blue value is replaced by 255 minus itself. Black text on white becomes white on black, and coloured elements become their complement — a red heading turns cyan, a blue link turns orange.

Pages come back as images

The result is rebuilt from the rendered bitmaps, so the output PDF holds one picture per page at the original page dimensions. Text is no longer selectable or searchable, and the file usually gets bigger — often several times bigger on a text document.

Choose the resolution and the codec

Render at 72, 144 or 216 DPI, and store the pages as lossless PNG or as JPEG with a quality slider. PNG keeps letterforms crisp and, on inverted text, is usually the smaller of the two as well; JPEG wins on scans and photographs, at the cost of faint ringing around type.

Frequently Asked Questions

What exactly does inverting do to the page?

Each page is drawn onto a canvas by the same renderer a browser uses to display PDFs, and then every pixel's three colour channels are replaced by 255 minus their value. It is a photographic negative, not a theme: white paper becomes black, black text becomes white, and colours are pushed to their complements, so red becomes cyan, green becomes magenta and blue becomes yellow. Mid-greys stay mid-grey. Photographs come out looking like film negatives, which is usually the ugliest part of the result.

Will the text still be selectable in the output?

No, and this is the main cost. The output pages are pictures. Nothing is selectable, nothing is searchable, links and bookmarks are gone, form fields become flat images of themselves, and a screen reader has nothing to read. If you need the words as well as the dark background, keep the original alongside the inverted copy, or pull the text out first with PDF to Text. Most PDF readers also have a built-in night or invert mode that changes only what you see and leaves the file untouched — worth checking before converting anything.

Why did my file get so much bigger?

Because a page of text stored as vector instructions and a subsetted font is remarkably compact, while the same page stored as a bitmap is not. The useful way to predict the result is per page rather than as a multiple of the original. On the text documents measured here, an A4 page as PNG came out between about a third and about half a megabyte at 144 DPI, and between about a half and about nine tenths of a megabyte at 216 — the denser the type, the higher in each range you land, whatever the source file weighed. A slim text document can therefore come back tens or even hundreds of times larger, while a PDF that was already mostly photographs may barely change or, as JPEG, shrink. If size matters, dropping the resolution is the reliable lever, because pixels go up with the square of the scale: 1x holds exactly a quarter of the pixels of 2x, and came out at a quarter to a third of the file size on the documents measured here. Switching to JPEG is not a size lever on type — at the default quality it made every text document measured here larger than PNG, and it only crossed under PNG somewhere around quality 55 to 65, by which point the white letterforms are visibly furred. Either way the result line tells you the real figure.

PNG or JPEG?

PNG is lossless, so it stores exactly what was rendered — the right choice for text, tables and line art, where JPEG's ringing artefacts show up as a grey halo around every letter. It is also, counter-intuitively, the smaller file for those documents once they are inverted: the flat black ground compresses to almost nothing under PNG, while JPEG pays for every glyph edge. Across three text documents measured here at the default quality, PNG was the smaller file in all nine combinations of document and resolution — though by twenty to forty per cent rather than by a multiple. JPEG earns its place on scans, photographs and heavy vector art, where it can be many times smaller: on a photographic document it beat PNG by roughly twenty-five times at 72 DPI and still by about seven times at 216, the margin narrowing as the render resolution climbs past the detail actually in the picture. So: choose by what is on the page, not by how many pages there are — type and line art means PNG, continuous-tone imagery means JPEG at 80 to 90. The margins swing a long way with the document, so if it matters, run it both ways and compare the sizes on the result line.

Is the page size preserved?

Yes. Each output page is created at the source page's displayed dimensions in points, and the image is drawn to fill it exactly, so an A4 page stays A4 no matter which resolution you render at. Pages carrying a /Rotate flag are rendered in the orientation a reader shows and written out upright, so the rotation is baked in rather than carried over as a flag. Mixed page sizes within one document are preserved page by page.

Does it work on scanned documents?

Yes, and scans are the case where inversion loses the least, because a scan is already a picture — there is no text layer to destroy. The output is a negative of the scan at whatever resolution you pick, which can actually help with faint pencil or carbon-copy originals where light marks on a light background become dark marks on a dark one. Note that rendering at 1x will look worse than the original scan if the original was captured at 300 DPI; use 3x to stay close.

What happens to metadata, attachments and annotations?

The output is a brand new document assembled from images, so nothing structural survives: no title or author metadata, no outline, no attachments, no separate annotation objects, no encryption, and no information dictionary at all — not even a producer name or a creation timestamp of its own. Annotations that the renderer paints as part of the page — highlights, stamps, filled form values — appear inside the image, inverted along with everything else. If stripping that structure is the actual goal, Remove PDF Metadata and Flatten PDF do it without rasterising.

A page came out blank, or the tab froze.

Rendering is the expensive part: an A4 page at 216 DPI is a canvas of roughly 1786 by 2526 pixels — four and a half megapixels — held at four bytes each while it is inverted and encoded. Very large pages — A0 drawings, poster-size sheets — can exceed the browser's maximum canvas at high scale, so the scale is automatically reduced for any page that would cross about 26 megapixels or 32,767 pixels on a side, rather than producing an empty image. That means the DPI you asked for is an upper bound: on a poster-size sheet, 3x and 2x can produce the same file. Whenever it happens the result line says how many pages were affected and how low the resolution actually went. If a long document still struggles, cut it up with Split PDF and invert the pieces. Everything runs in this tab; nothing is uploaded, and the original file on your disk is never modified.