Pretty-Print JSON Into a Clean PDF
Reparses and reformats your JSON with two-space indentation, then typesets it in a monospaced face at your chosen size. Invalid JSON is rejected with the parser's own error message, so the tool doubles as a syntax check.
About the JSON to PDF Converter
Minified JSON is unreadable by design. This converter parses the file and writes it back out with proper indentation and one value per line, so nested objects and arrays step across the page the way you would see them in an editor. It then typesets that in Courier at 9, 11 or 13 point on A4 or US Letter.
There is a useful side effect. Because the file has to be parsed before it can be reformatted, anything that is not valid JSON fails immediately — and the message you get back is the JavaScript engine's own parse error, naming the problem and its position. If a conversion is refused, you have learned something more valuable than a PDF.
Key Features
- Genuine structural indentation: The data is parsed and re-serialised with two-space indenting, so nesting depth is visible as shape on the page rather than implied.
- Validation built in: Malformed JSON is rejected before conversion with the precise parse error, including where the parser gave up.
- Monospaced output: Courier keeps keys, values and indentation aligned vertically, which is what makes a deeply nested structure scannable.
- Three text sizes and two paper sizes: Nine point fits a large configuration onto a manageable number of pages; A4 or US Letter to suit the destination.
- Consistent formatting regardless of input: The output looks the same whether the source was minified into one line or already prettily formatted, because it is rebuilt from the parsed data.
- Nothing is transmitted: Parsing and layout both happen in this tab from a library stored on this domain, so payloads containing real data are never sent to a formatting service.
How to Use the JSON to PDF Converter
- Add the .json file you want as a document.
- Pick a text size and paper size.
- Press Convert to PDF.
- If it reports a parse error, fix the file at the position given and try again.
How It Works
Because the file is parsed and rebuilt rather than reformatted textually, a few properties of the data are worth understanding.
Comments are not permitted in strict JSON, so a configuration file written with them — which many tools tolerate — will be rejected as invalid. Duplicate keys within the same object silently collapse to the last occurrence, since that is how parsing works, meaning a file with an accidental repetition will convert with one of the values quietly gone. Numeric keys are reordered ahead of string keys and sorted numerically, which can rearrange an object whose keys are numbers. And very large integers beyond the range JavaScript represents exactly will lose precision in the round trip — relevant if your data contains long identifiers stored as numbers rather than strings.
None of these affect ordinary configuration files or API payloads, but if the PDF is intended as an exact record of a file rather than a readable rendering of its data, keep the original alongside it.
As with any conversion through the built-in monospaced font, characters outside the Western European range will not render — string values containing Chinese, Japanese, Arabic or Cyrillic text will come through as blanks.
When You Need It
A developer documenting a webhook payload for a partner's integration team needs a version that can be attached to a specification and read by people who will not be opening a code editor. A formatted PDF sits in the document set alongside everything else, and the payload structure — which may reflect internal data models the partner has signed an agreement to see and nobody else has — does not pass through a public formatter on the way there.
An engineer preserving an API response as evidence in a billing dispute wants a fixed, dated, unalterable record of exactly what the service returned. Converting it to a PDF gives a document that can be attached to correspondence, and doing so locally means the response — which typically contains account identifiers and usage data — is not disclosed to a third party in the course of documenting a disagreement with the second one.