Convert YAML to PDF in Your Browser

Convert YAML to PDF as syntax highlighted text, with indentation and comments preserved exactly as written, all in your browser. Your YAML never leaves your device, and the tool keeps working offline.

Tap to select a file

Files are processed on your device only.

How it works

  1. Drop, paste, or select your .yaml or .yml file. It is read on your device only.
  2. Choose page size, font size, and a light or dark theme.
  3. Click Print or Save as PDF, enabling Background graphics so colors print.

Highlighting that keeps indentation and comments

YAML is whitespace-significant, so the converter renders it in a monospace block that preserves every level of indentation, then colors keys, values, anchors, and comments with the same grammar an editor uses. Nothing is reformatted, which matters for a language where a stray space changes meaning.

For a single snippet in another language the code to PDF converter works the same way, and for pretty-printed data with an optional table view the JSON to PDF converter is the closer fit.

Comments, long configs, and printing the colors

Comments and multi-document files (separated by the document marker) are kept intact, and a long configuration flows across pages with each line unbroken. Because browsers strip background colors when printing, enable "Background graphics" in the print dialog so the highlighting reaches the PDF, the same step the dark theme needs.

See how browser-side rendering works for the parser-to-print pipeline behind every converter here.

Frequently asked questions

Is my YAML validated or reformatted?
No. The text is highlighted exactly as written, not parsed, linted, or re-indented, so invalid YAML still prints as-is and your original spacing and comments are preserved. If you need a linted or normalized file, run it through a validator first, then convert the corrected version here.
Are both .yml and .yaml accepted?
Yes. The converter checks the file content, not its extension, so .yml, .yaml, or YAML pasted with no extension all work. Files that do not look like YAML (for example a JSON object or array) are declined with a notice rather than mis-highlighted.
Why highlight the text instead of building a table?
YAML nests to arbitrary depth and mixes mappings with sequences, so a faithful highlighted view keeps the structure readable in a way a flat table cannot. For data that really is an array of objects, the JSON to PDF converter renders a table from JSON.
Is my YAML uploaded anywhere?
No. Highlighting and PDF rendering run entirely in your browser on your device. The YAML never leaves the machine, there is no account, and the converter keeps working with the network disconnected.

Related tools