How to Convert JSON or YAML to PDF: Table, Chart, Tree or Code
Published on August 16, 2026
You can convert JSON or YAML to PDF for free, in your browser, choosing table, chart, tree or color-coded code, with a theme and a logo. See how and what you get.
How to convert JSON or YAML to PDF
To convert JSON or YAML to PDF, upload the .json, .yaml or .yml file in the Convert JSON or YAML to PDF tool, choose how to present the data (Table, Chart, Tree or Code) and click "Generate PDF and download". The PDF comes out in A4 (the Table in landscape A4), with a header, date and page numbers, and the text stays selectable and searchable. Everything runs in your browser, without sending the file to any server.
It is the answer for anyone who needs to attach a configuration, a system response or a list of records to a ticket, a report or an email without dumping raw, misaligned text. The tool reads the file, works out which presentations fit it and suggests the best one. If the file is plain text, Markdown or an HTML page, the converter is a different one: see how to convert TXT, Markdown or HTML to PDF.
Four ways to present the same data
As soon as the file is in, the panel analyzes the content and shows only the modes that make sense for it. The automatic suggestion follows this order: Table, when the data is a list of items; Tree, when there is nested data; Code, for any file. You can switch modes before generating.
- "Table": the data is a list of items and becomes a table with columns and rows and a highlighted header repeated on every page. Only offered when the file is a list of similar records. A nested value inside a cell becomes a summary, such as "[3 itens]" or "{2 campos}" (the summary is written in Portuguese).
- "Chart": a numeric column becomes a chart. You pick the "Value column (numbers)", the "Label column" and the "Chart type": Bars, Line or Pie. Only offered when there is at least one column of numbers. Bars are horizontal and continue on new pages when there are many rows; Line and Pie fit on a single page, and in Pie zero values are left out.
- "Tree": nested data in an indented view, easier to read than the raw file. With Tree selected, the "Include a table of contents" box appears inside "Appearance (optional)": the PDF gets, at the start, an index of the main sections with the page of each one.
- "Code": the whole file, color-coded by type (keys, strings, numbers), just as it was written, in a monospaced font with the indentation preserved.
If the file is not a list of items, Table mode is not offered; if there is no numeric column, Chart stays out. When neither Table nor Tree fits (a file with a single value, for example), the mode selector does not even appear and the PDF comes out as Code. With several files at once, the analysis uses only the first one and the chosen mode applies to all; if another file does not fit it, you see a warning such as "This data doesn't form a table. Use Code mode." and generation stops at that file.
Step by step to generate the PDF
- Open the "Convert JSON or YAML to PDF" tool.
- Upload the .json, .yaml or .yml file; the tool analyzes the content and pre-selects the suggested mode.
- Choose how to present it: "Table", "Chart", "Tree" or "Code". In Chart, set the value column, the label column and the type (Bars, Line or Pie).
- Open "Appearance (optional)" to pick the "Theme" (Light, Dark, Corporate or Print, which saves ink) and upload a "Logo in the header" as PNG or JPG. With Tree selected, this is where the "Include a table of contents" box lives.
- Click "Generate PDF and download". The file downloads with the original name and the .pdf extension; with several files the button reads "Generate N PDFs" and you get one PDF per file.
In every mode, the PDF gets a header with the file name and the generation date (written day/month/year), the logo if you uploaded one, and page numbers in the footer, such as "1 / 3". The text is drawn as text, not as an image: you can select, copy and search it in your PDF reader. Long content is split across pages instead of running off the margin.
Appearance: themes and logo
- Light: white background and vivid colors per data type, the default for on-screen reading and everyday printing.
- Dark: dark background with an adjusted palette, for reading on screen.
- Corporate: more restrained tones, designed for reports and formal attachments.
- Print (saves ink): shades of gray, no strong colors, for printing many pages.
- Logo in the header: PNG or JPG, shown at the top of every page next to the file name and date. If the image cannot be read, the PDF comes out without a logo, with no warning.
When to generate a PDF from your data
- Document a system's configuration and file it with the rest of a project's paperwork.
- Attach a data file to a ticket, a report or an email without relying on the recipient having a code editor.
- Record the state of a configuration at a specific moment, as a readable, dated receipt.
- Present a list of records as a table or a chart in a meeting, for people who do not open JSON or YAML day to day.
JSON and YAML: which one to use
Both formats represent the same data in different ways. JSON is the standard for exchange between systems; YAML is leaner and common in configuration files because it is easy to read and write by hand. The tool accepts both and applies the same modes and themes, so use whatever you already have. If the file is a system response, it is probably JSON; if it is a program's configuration, it is often YAML. To switch from one format to the other before generating the PDF, see how to convert JSON to YAML, YAML to JSON and XML to JSON.
Limits worth knowing
There is no choice of paper size or font: the PDF always comes out in A4, portrait in Code, Tree and Chart modes and landscape in Table. Characters outside the Latin alphabet, such as Chinese, Japanese and emoji, disappear from the PDF without warning, because the embedded font only covers the Latin alphabet with accents. Chart mode plots one series at a time, from one numeric column; to compare several columns, generate one PDF for each. A JSON or YAML file with a syntax error is not converted: you see "Could not read this JSON. Check that it is well formed." or "Could not read this YAML. Check the indentation and syntax."
The conversion happens entirely in your browser: the file is processed on your own device and is never sent to any server.
To check whether Table will show up: the file needs to be a list of items with the same fields, such as a list of products or people. A single object with nested sections goes to Tree or Code.
