11 min readpdf

How to Convert JSON and XML Files to PDF (Formatted & Readable)

Convert JSON and XML files to clean, readable PDFs with proper formatting. No uploads, no accounts, no desktop software. Perfect for API responses, config files, and data exports.

TL;DR

Converting JSON or XML to PDF usually means ugly raw text or broken formatting. Convert: Anything to PDF renders structured data files into clean, readable PDFs with proper formatting — entirely on your device, no uploads, no accounts.

Why developers need JSON and XML to PDF conversion

JSON and XML are the backbone of modern data exchange. API responses come back as JSON. Configuration files are written in XML. Data exports from databases, analytics tools, and SaaS platforms arrive in one of these two formats. But when you need to share that data with someone who does not live in a terminal — a project manager, a client, an auditor — you need a human-readable document.

Common scenarios

API documentation — You have captured API responses and need to include them in a technical document or client report. Raw JSON pasted into a Word doc looks terrible.

Configuration audits — A security review requires documentation of your application's configuration files. XML config files need to be archived in a format that non-technical reviewers can read.

Data exports for stakeholders — You pulled data from an API or database export. The product manager needs to review it, but asking them to open a .json file is not going to work.

Debugging records — When tracking down a bug, you save API responses or state dumps for later analysis. A PDF creates a timestamped, shareable record.

Compliance and archival — Regulatory requirements sometimes mandate that data be stored in a non-editable, human-readable format. PDF is the standard for this.

The problem with existing approaches

Copy-paste into a document

The most common approach: copy the JSON or XML, paste it into Google Docs or Word, and export to PDF. The results are consistently bad:

  • Lost formatting — Indentation disappears or becomes inconsistent
  • No syntax highlighting — Everything is the same color and weight, making it impossible to scan
  • Line wrapping breaks structure — Long lines wrap in ways that obscure the data hierarchy
  • Manual cleanup required — You spend more time fixing the formatting than it took to get the data

Online converters

Web-based JSON-to-PDF tools exist, but they introduce problems:

  • Data uploads — Your JSON or XML is sent to a remote server. If the data contains API keys, customer information, internal configurations, or any sensitive content, this is a security risk.
  • Unreliable formatting — Most online tools produce output that is only marginally better than raw text
  • Account requirements — Many services gate the conversion behind a free trial or account wall
  • File size limits — Large data exports hit free-tier caps quickly

Pretty-print and screenshot

Some developers pretty-print JSON in a code editor, then take a screenshot. This works for small snippets but fails for anything longer than a single screen. Multi-page JSON files cannot be captured this way, and the output quality depends on monitor resolution.

You can paste JSON into a browser tab and use the print dialog. But the browser renders it as plain text with default fonts, no syntax awareness, and page breaks that cut through data structures mid-object.

How Convert: Anything to PDF handles structured data

Convert: Anything to PDF recognizes JSON and XML as structured data formats and renders them with formatting that preserves readability.

What you get

Proper indentation — Nested objects and arrays maintain their hierarchical indentation in the PDF output. You can visually trace the structure of the data.

Readable typography — The extension uses a monospace font appropriate for code and data, with consistent spacing that keeps columns aligned.

Page-aware rendering — Long files flow across multiple pages with clean page breaks. The output does not cut off mid-line or mid-object.

Paper size options — Choose A4, Letter, or Legal depending on your documentation standards.

Step-by-step conversion

  • Install Convert: Anything to PDF from the Chrome Web Store
  • Click the extension icon
  • Drag and drop your .json or .xml file into the extension
  • Select paper size
  • Click Convert
  • Download your formatted PDF

The entire process takes seconds. No server communication, no processing queue, no waiting.

Working with JSON files

API response documentation

When you need to document API responses — for internal wikis, client deliverables, or onboarding materials — the workflow is straightforward:

  • Save the API response to a .json file (most API testing tools like Postman, Insomnia, and curl support this directly)
  • Drop the file into the extension
  • Convert to PDF

The output preserves the structure of the response, making it easy for readers to understand the data schema.

Large JSON files

JSON exports from databases or analytics platforms can be substantial — thousands of lines with deeply nested objects. The extension handles these without file size limits. The practical constraint is your device's memory, which accommodates most real-world files without issue.

JSON arrays and tabular data

If your JSON file contains an array of objects with consistent keys — essentially tabular data in JSON format — the PDF output preserves the array structure with proper indentation. For truly tabular JSON data, consider converting it to CSV first (using any JSON-to-CSV tool) and then using the extension's CSV-to-PDF feature, which renders a formatted table with columns and rows.

Working with XML files

Configuration files

XML configuration files — Maven pom.xml, Spring application contexts, web.xml, .csproj files — are common targets for PDF conversion. Configuration audits, security reviews, and infrastructure documentation all benefit from having config files in a readable, archivable format.

Data interchange files

XML remains the standard format for many enterprise data exchanges: SOAP responses, HL7 health records, financial reporting formats like XBRL, and government data feeds. Converting these to PDF creates a human-readable reference that can be attached to reports or stored for compliance.

XSLT-transformed XML

If your XML has an associated XSLT stylesheet, you would typically transform it to HTML first, then convert that HTML to PDF. The extension supports HTML-to-PDF conversion as well, so the full pipeline works:

  • Apply XSLT to produce HTML
  • Save the HTML file
  • Drop it into the extension for PDF conversion

Combining data files with other content

One of the most useful features for developers is the ability to merge multiple files into a single PDF. This enables document assembly workflows that would otherwise require a dedicated tool.

Technical report assembly

Build a complete technical report by dropping files in order:

  • report-intro.md — Markdown file with the report title and summary
  • api-response-users.json — User endpoint response
  • api-response-orders.json — Orders endpoint response
  • config.xml — Application configuration
  • architecture-diagram.png — System diagram image

All of these merge into a single PDF with each file rendered on its own page(s). The Markdown file renders with headings and formatting. The JSON and XML files render with proper indentation. The PNG renders as a full-page image.

Debugging packages

When filing a detailed bug report or creating a debugging record, you can merge:

  • A text file describing the issue
  • The JSON request payload
  • The JSON response payload
  • A screenshot of the error
  • The relevant XML configuration

One PDF, one attachment, complete context.

Capturing web-based data as PDF

If the data you need to convert is displayed on a web page rather than saved as a file — for example, an API response rendered in a browser, a dashboard showing JSON data, or an XML feed in a browser tab — the companion extension Convert: Web to PDF captures the page content as a clean PDF. Use it for live web content, and use Convert: Anything to PDF for local files.

Privacy considerations for developers

Why local processing matters

Developers frequently work with data that should never leave the local machine:

  • API keys and tokens — JSON config files and API responses often contain authentication credentials
  • Customer data — Database exports may include PII that is subject to GDPR, CCPA, or HIPAA
  • Internal infrastructure details — Configuration files reveal server addresses, database connection strings, and service endpoints
  • Proprietary algorithms — Data structures may reveal business logic or competitive information

Online converters that upload your files to a server expose all of this. Even if the service claims to delete files after processing, the data has already traversed the internet and been stored, however briefly, on a third-party server.

On-device processing

Convert: Anything to PDF processes everything in your browser. The file is read from your local disk, rendered in the browser's rendering engine, and saved back to your local disk as a PDF. No network requests are made during conversion. Your data never leaves your computer.

Comparing approaches

JSON/XML to PDF: method comparison

Online converters — Require file upload, introduce privacy risks, impose size limits, often require accounts. Formatting quality varies.

Copy-paste to Word/Docs — Loses indentation and structure, requires manual formatting cleanup, time-consuming for large files.

Screenshot — Only works for small snippets, resolution-dependent, cannot capture multi-page files.

Print from browser — Plain text rendering, no structure awareness, poor page break handling.

Convert: Anything to PDF — Local processing, preserves formatting, handles large files, no size limits, no account, no uploads.

Frequently asked questions

Does the extension validate JSON or XML before converting?

The extension converts the file content as-is. If your JSON is malformed (missing brackets, trailing commas), it will still convert to PDF showing the content as it exists in the file. It does not parse or validate the data structure.

Can I convert minified JSON to a readable PDF?

If your JSON file is minified (all on one line with no whitespace), the PDF will reflect that. For best results, pretty-print your JSON before conversion. Most code editors can do this automatically — in VS Code, use Shift+Alt+F to format the document. You can also use command-line tools like python -m json.tool input.json > formatted.json.

What about very large JSON files?

There is no file size limit imposed by the extension. Files with tens of thousands of lines convert without issue on modern hardware. Extremely large files (hundreds of megabytes) may take longer to process depending on your device's available memory.

Can I convert multiple JSON files into one PDF?

Yes. Drop multiple .json files (or a mix of .json, .xml, and other supported formats) into the extension. They merge into a single PDF in the order you arrange them.

Does it preserve JSON syntax highlighting with colors?

The extension renders JSON and XML with proper formatting and indentation using a monospace font. The focus is on structural readability rather than IDE-style color syntax highlighting.

Can I convert YAML files to PDF?

YAML is not currently in the list of supported formats. However, YAML can be converted to JSON using command-line tools (yq or Python), and the resulting JSON file can then be converted to PDF with the extension.

Does it handle nested XML with namespaces?

Yes. The extension preserves the full XML content including namespace declarations, attributes, and nested elements. The output reflects the complete XML structure as it appears in the source file.

Is there a way to convert a JSON API response directly from the browser?

If the JSON is displayed in a browser tab (for example, from navigating directly to an API endpoint), you can use Convert: Web to PDF to capture the page as a PDF. For saved .json files on your disk, use Convert: Anything to PDF.

Bottom line

JSON and XML files are essential for developers but unreadable for most stakeholders. Convert: Anything to PDF turns structured data files into clean, formatted PDFs without uploading your data to a server, creating an account, or installing desktop software. Drop in your files, convert, and share — your data stays on your device the entire time.

Try our free Chrome extensions

Privacy-first tools that actually work. No paywalls, no tracking, no data collection.