What flattening a PDF means
To flatten a PDF is to convert its live form fields into static page content: the value each field currently shows is drawn onto the page, and the field itself is removed. Before flattening, a filled form is really two things at once - a page drawing, and a set of separate field objects sitting on top of it, each holding a value a reader can change. After flattening there is only the page. That single change explains every use and every warning in this guide. The document looks the same, prints more reliably, and can no longer be filled in, cleared or quietly altered in its fields.
People search how to flatten a PDF for a handful of recurring reasons. A government portal, university admissions system or employer upload form rejects a file that still contains live fields, or demands a flattened copy by name. A completed application needs to be emailed as a finished record, not as a form the recipient can edit. A printer or a cheap viewer shows empty boxes where the answers should be, because it never drew the field layer. In each case the fix is the same: freeze the answers into the page, keep the editable original safe, and send the flattened copy.
How to flatten a PDF, step by step
The workflow has four steps. Step one: add your PDF with the file picker. The tool opens it locally with pdf-lib, counts the pages, and counts the AcroForm fields it finds. Step two: read that report before you do anything else. It tells you the page count, the number of form fields found, and the original file size, so a file with zero fields does not surprise you later. Step three: choose the annotations option. By default remaining annotations are left alone; ticking the option removes them after the fields are flattened. Step four: click Flatten PDF, read the before and after report, and download the new file, named with -flattened added.
Two habits make the job foolproof. First, fill and proofread the form before you bring it here - flattening freezes what is shown, mistakes included. Second, open the downloaded result and click where a field used to be. If nothing responds and the values are all visible, the flattening worked. If a value is missing or wrong, go back to the original, fix it there, and flatten again. There is no limit on attempts, and your original is never changed by this page.
Flatten form fields: what happens to each field type
A text field flattens to the text it displays, drawn at the field position in a standard appearance. A checkbox flattens to its current mark - ticked or empty - drawn as page graphics, which is why a checked box still looks checked after flattening. A radio group flattens to the selected button state. A dropdown or list box flattens to the chosen option text. In every case the rule is identical: what the field showed becomes page content, and the interactive object behind it is deleted. The report on this page counts fields, not widgets, so a radio group with four buttons counts as one field.
Three edge cases deserve honesty. A hidden field has no visible appearance to draw, so its value does not appear on the page after flattening - flattening never reveals hidden data. A field with no stored appearance depends on the viewer to draw it; this tool refreshes field appearances before flattening where pdf-lib can, but an unusual custom font or a field built by exotic software can still render plainer than it looked in a desktop reader. And a signature field is a form field too: flattening it removes its interactive and signed status, which the signature section below covers in full.
What flattening does and does not do
The table below is the honest summary of this tool, and of form flattening generally. Read the does not column as carefully as the does column, because most disappointment with flattened PDFs comes from expecting the second column to be longer than it is. Flattening is a finishing step for completed forms. It is not a security step, not a cleanup step for hidden data, and not a way to stop a determined editor from changing page content with proper editing software.
| Element | Flattening does | Flattening does not |
|---|---|---|
| Text fields | Draws the displayed value into the page and removes the field | Does not keep any editable copy of the value |
| Checkboxes and radio buttons | Draws the current ticked or selected state into the page | Does not let anyone change the choice afterwards |
| Dropdowns and list boxes | Draws the chosen option text into the page | Does not keep the other options as a live list |
| Signature fields | Removes the field as part of the form | Does not preserve the signature - signatures are invalidated |
| Other annotations | Left as they are by default; removed only if you tick the option | Does not draw annotations into the page - pdf-lib does not support that |
| Optional content layers | Left as they are | Does not merge layers or flatten print transparency |
| Page text and images | Left exactly as they were | Does not lock them - a PDF editor can still change page content |
| Hidden data and metadata | Left as they are | Does not redact, erase or clean hidden information |
| Security | Makes form answers fixed against casual editing | Does not encrypt, password-protect or certify the file |
Flatten annotations and layers: the honest limits
The phrase flatten PDF is used for three different jobs, and confusing them causes real mistakes. Form flattening, the job this page does, converts AcroForm fields into page content. Annotation flattening in desktop tools such as Acrobat Preflight converts comments, highlights and stamps into page content as well. Transparency and layer flattening in print production merges overlapping artwork and optional content layers for a press - a completely different operation that shares only the name. If a print shop asks for flattened transparency, this page is not the tool for that job.
Within this page, pdf-lib sets the boundary: its form.flatten() method flattens form fields, and that is the flattening it supports. Standalone annotations - a sticky note, a highlight, a stamp that is not a form widget - are not converted into page drawings by that method. This tool therefore offers the only honest alternative pdf-lib supports: leave remaining annotations as they are, which is the default, or remove them after flattening by ticking the option. Removal is not flattening - the annotation disappears rather than becoming page content - and the report and the option label both say so. Optional content layers, often called OCGs, are likewise not merged by pdf-lib and remain as they were.
Make a PDF non editable: what that really means
Flattening is often described as a way to make PDF non editable, and that description needs narrowing before it misleads anyone. After flattening, the fields cannot be edited, because they no longer exist. The recipient cannot change your name answer, untick your checkbox, or clear the form with a reset button. For the ordinary purpose - sending a completed form that should arrive exactly as you completed it - that is exactly the protection people want, and it needs no password and no special reader at the other end.
What flattening does not do is lock the document. The page content itself - headings, paragraphs, the flattened values now drawn as text and graphics - can still be altered by anyone with a PDF editor, copied, or covered over. Nothing is encrypted, no permissions are set, and no trace of a later change is left. If a document must resist editing, or prove that it was not changed, that is the job of encryption, permissions and digital signatures applied to the final file - in that order, after flattening, never instead of understanding the difference.
Digital signatures are invalidated by flattening
A digital signature covers the exact bytes of the document at the moment it was signed. Any later change - and flattening is a large change, rewriting pages and deleting fields - breaks that coverage, so readers will report the signature as invalid or the document as changed since signing. A signature field is also itself a form field, so flattening can remove the field entirely, leaving at most a picture of how it looked. A flattened copy of a signed document is not signed evidence of anything.
The correct order is therefore strict: fill the form, check it, flatten it, and only then sign the flattened final copy if a signature is needed. Never flatten a document whose existing signature you must preserve - a signed contract, a certified submission, an approved form - because there is no way back from that copy. Keep the signed original untouched, and if a portal demands both a signature and a flattened file, ask which order it expects before you destroy the thing it asked for.
Worked example: a one-page form, verified
Here is the exact job this page was verified against during its own testing. A test PDF was generated in code with pdf-lib: one page, a text field named full_name holding the value Aoun Testvalue, and a checkbox named agree, ticked. Before flattening, the form reported 2 fields. The same flatten path this page uses was then run - load the file, refresh field appearances, call form.flatten(), and save. The output was reloaded and inspected independently.
The reloaded output contains 0 form fields and still contains 1 page. The field value is present in the page drawing: the decoded content streams contain the text Aoun Testvalue, drawn where the text field sat, and the checkbox drawing with its tick is likewise drawn into the page. In other words the answers survived as visible page content while the fields themselves are gone - which is the whole definition of flattening, checked rather than assumed. The example generalises directly: on a real form, fields after flattening should always count zero, and every value should still be visible on the page.
Privacy: your file never leaves your device
Most online PDF tools ask you to upload your document to their server, process it there, and offer it back for download - which means a copy of your completed tax form, visa application or employment contract sits on a machine you know nothing about, for a retention period you cannot verify. This page works the other way. The pdf-lib library is loaded with the page and runs as ordinary JavaScript inside your browser tab. Your file is read from your device, flattened in memory, and handed back as a download generated locally. No upload takes place at any step - the privacy is not a policy promise, it is the architecture of the page. You can confirm it yourself: load the page, switch your device to flight mode, and the tool still works end to end.
The consequences are practical. There is no account holding a history of your documents and no server copy to be breached or quietly kept. Closing the tab clears everything, because the file existed only in that tab memory. The flip side is equally plain: because nothing is stored, the page cannot recover a result for you after you close it - save the download before you close the tab. For completed forms, which are among the most sensitive documents people handle, this trade is the right one.
Flattening is not redaction and not security
This distinction matters enough to state on its own. Flattening is not redaction. Redaction permanently removes information - the text, image or data is deleted so it cannot be recovered from the file. Flattening removes nothing except interactivity: everything that was visible stays visible, and data that was hidden, layered underneath, or stored as metadata is not cleaned by flattening a form. Never send a flattened file believing that something sensitive inside it has been erased. If it had to go, it has to be redacted or removed before flattening, with a tool built for that purpose.
Flattening is not security either. It sets no password, applies no encryption, and imposes no permissions. The flattened file opens for anyone, copies freely, and can be edited at page level. Its one protective quality is narrow and real: casual changes to the form answers are no longer possible, because there are no fields to change. Treat that as protection against accidents and casual tampering, never as protection against anyone determined. Sensitive completed forms still deserve encrypted storage and careful sending, flattened or not.
Encrypted, damaged, scanned and XFA PDFs
A password-protected PDF is encrypted: its contents are scrambled with a key derived from the password, and no tool can flatten fields inside it without first unlocking it - that is the entire point of the protection. When this page receives an encrypted file, pdf-lib cannot open it, and the tool tells you plainly that the file could not be read and may be encrypted. The route around is legitimate and simple: open our PDF Password Remover, type the password you know, save the unlocked copy, and flatten that copy here. If the password is forgotten, there is no honest route.
Damaged files fail the same honest way: a PDF truncated by a bad download may refuse to open, and the tool reports the failure rather than producing a silently broken result. Scanned PDFs open perfectly but usually contain no fields at all - each page is a picture - so the report shows zero fields and there is nothing to flatten; this tool does no OCR and a scan stays a picture. XFA forms, a different form technology found in some older government documents, are not AcroForm fields and are not supported by pdf-lib flattening; such documents need the desktop application that created them.
Flatten, protect, sign or print to PDF: choosing
Four finishing jobs are often confused. Flatten PDF (this page) freezes completed form fields into the page - use it when a form is finished and a portal, employer or printer needs the answers fixed. Protect PDF adds a password and encryption - use it when the file itself must be restricted, on the final copy. Signing proves identity and detects later changes - apply it last, after flattening and protecting decisions are settled. Print to PDF from a reader also produces a static copy, but it re-renders every page, can change fonts, size and quality, and gives you no field count or report.
A sensible pipeline chains in this order: unlock if needed, fill and proofread, flatten, check the flattened copy, then protect or sign the final file if required, and compress last if size is a problem. Finishing touches such as page numbers or a watermark belong on the final file too, not on an intermediate you are about to rewrite. Keeping the editable original at every stage is what makes the whole chain safe: each step creates a new file, and any step can be redone from the stage before it.
Common mistakes and how to avoid them
Flattening the only copy. The single worst flattening mistake. This tool never edits your original, but people then save over it or delete it - keep the fillable original until the recipient confirms the flattened copy is accepted. Flattening before proofreading. A misspelled name or a wrong date flattens just as permanently as a correct one; read every field on screen first. Flattening a signed document. As the signature section explains, that destroys the signature - check for signatures before you start, not after.
Expecting flattening to hide data. It hides nothing and secures nothing; hidden fields, metadata and layered content are untouched by form flattening. Removing annotations by accident. The annotations option on this page removes remaining annotations only when you tick it - leave it unticked if comments or stamps must stay live, and understand that removal deletes rather than draws them. Closing the tab before saving. Nothing is stored anywhere, by design - the save click is the final step of the job, not an optional extra.
What this tool cannot do
Plainly stated: this tool flattens AcroForm form fields in one PDF at a time, with an option to remove remaining annotations afterwards, and that is the boundary of what it does. It cannot merge optional content layers or flatten print transparency, convert standalone annotations into page drawings, redact or delete hidden information, encrypt or password-protect the result, preserve a digital signature through flattening, unlock a PDF whose password you do not know, repair a corrupt file, flatten XFA forms, or run OCR on scans. It makes no use of AI, and it does not fill in a form for you - the values must already be in the fields.
Two limits come from the in-browser design itself. Very large files are bounded by your device memory, because the file and the flattened copy share one tab - there is no server to offload to, by choice. And flattening changes file size unpredictably: removing field objects can shrink a file, while drawing appearances into pages can grow it, so the report simply states both sizes honestly rather than promising a smaller file. Within those bounds the tool is complete: every AcroForm field frozen into the page, counted before and after, with your original untouched and your document never uploaded.
Sources & References
- pdf-lib - the open-source library this page uses to load a PDF, count and flatten its AcroForm fields with form.flatten(), and save the result, entirely inside this page.
- pdf-lib on GitHub - the library source and documentation, including PDFDocument.load, PDFForm.getFields, updateFieldAppearances, flatten and save. This page loads the maintained @cantoo/pdf-lib 2.11.1 build of the same library.
- iText Knowledge Base - documentation from the iText PDF library team on working with PDF forms, including filling and flattening form fields as a finishing step.
- pdf.js - Mozilla open-source PDF viewer library, the viewer technology used across this site PDF tools for reading and rendering PDF pages in the browser.
- pdf.js on GitHub - the viewer library source and documentation, including how PDF documents and their form and annotation layers are read in the browser.
- MDN - File API: the File interface, how the browser represents a file you pick on your device, which is how this page reads your PDF without uploading it.
- MDN - Blob: how the flattened PDF is packaged in the browser so it can be downloaded straight back to your device.
Source note: Adobe Acrobat help pages and the PDF Association site were checked for this guide on 24 November 2026 but did not return a usable page to our checker (Adobe returned 404 and 403 responses and the PDF Association returned 403), so they are not listed above. The iText Knowledge Base and the MDN File and Blob references were substituted in their place, and every source listed above returned HTTP 200 when checked. Every figure in this guide was checked against the method described on this page, so you can reproduce each one exactly with the tool above.