Docs / Editing tools
Format conversion
Last updated:
Prettify converts the open document between JSON, JSONL, YAML, CSV, and XML. Conversion runs on your device; nothing is uploaded. Format conversion is free in Prettify.
Convert the open document
Load a document in one of the data formats, then convert it.
- Open the editor and load your data.
- Click Convert in the editor toolbar, under the Transform group.
- Pick the target format from the menu.
You can also open the Command Palette with Cmd+K (Mac) / Ctrl+K (Windows, Linux) and choose a convert command.
The converted text opens in the current tab as a separate document, named after the original with the target format, such as orders (CSV). The original document stays in History, unchanged. If a document with that name and format already exists, the conversion is saved as a new version of it. The source and target must both be data formats. Mermaid, Markdown, MDX, HTML, and SVG are text documents, so they have no convert menu.
What each target can carry
Every format holds a different shape of data, so some detail cannot move across. Prettify shows a warning when a conversion drops or changes something. The table lists the common cases.
| Conversion | What changes |
|---|---|
| Any format to CSV | CSV holds a table of rows. A non-array document is wrapped in an array. A nested object becomes dotted columns, such as address.city. An array stays in one cell as JSON text. Converting the CSV back keeps address.city as one key. A text value that starts with =, +, -, or @ gets a leading ', so a spreadsheet shows it as text and does not run it as a formula. Plain numbers such as -5 do not change. |
| Any format to XML | Keys that are not valid XML names are renamed. A single-item array becomes one element and reloads as a single value, not an array. |
| XML to JSON | XML attributes become @attribute keys. |
| YAML to JSON | YAML comments are removed. |
| Any format to JSONL | A non-array document becomes a single-element array when it is reloaded as JSONL. |
| CSV with a preamble | Metadata lines above the CSV header are not included in the output. |
Large or high-precision numbers are preserved exactly in JSON and JSONL. Converting such numbers to YAML, CSV, or XML may lose precision, and Prettify warns when it does.
Batch convert many files (Pro)
Batch Processing (Pro) converts whole folders of files at once.
- Open Batch process from the dashboard, or the Command Palette.
- Add files, or a folder.
- Choose the Convert operation and a target format.
- Run the batch, then download the results as a zip, or save them to a folder.
Batch Processing accepts up to 200 files and 50 MB total per run. A file that cannot be converted is skipped or reported, so one bad file does not stop the batch. Batch Processing is part of Prettify Pro.
Related
Try it online
Tool pages for this topic. Each one runs in your browser.