Docs / Editing tools
Transforms
Last updated:
Transforms reshape the open document inside the editor. Prettify can sort keys, format text, and build queries. Sort Keys and Format are free; the query tools are part of Prettify Pro.
Sort Keys
Sort Keys orders every object key alphabetically, from A to Z. It descends into nested objects and arrays, so the whole document is sorted.
- Load a document.
- Click Sort Keys in the editor toolbar, under the Transform group.
Sort Keys works on JSON, JSONL, YAML, CSV, and XML. For CSV, it sorts the columns of each row. The sorted result replaces the document and is saved as a new version.
{ "name": "Ada", "age": 36, "active": true }
After Sort Keys:
{ "active": true, "age": 36, "name": "Ada" }
Format
Format rewrites Markdown and MDX with Prettier, so spacing, lists, and tables follow one consistent style.
- Load a Markdown or MDX document.
- Click Format in the editor toolbar.
Format is available only for Markdown, MDX, and HTML. For data formats, Prettify already pretty-prints the output, so there is no separate Format action. Prettify tells you when the document is already formatted.
Transform Wizard (Pro)
The Transform Wizard is a visual query builder inside the jq Query panel (Pro). It writes the jq query for you, and the query stays visible and editable.
The wizard has three controls.
- Filter: keep records that match a condition, for example a field that equals or contains a value.
- Sort: order records by a field.
- Pick: choose which fields to keep.
To use the wizard, open the jq panel and switch to the wizard. The wizard regenerates the query as you change the controls. When you edit the query by hand, the wizard stops overwriting it until you resync. The jq engine is part of Prettify Pro; see jq queries.
Query transforms (Pro)
The query tools transform data and apply the result back to the document.
- jq queries filter and transform JSON, JSONL, and YAML.
- SQL queries run SELECT statements over CSV.
- XPath queries select nodes from XML.
Each query tool is a Pro feature. Free users get one try of each Pro tool per day.
Related
Try it online
Tool pages for this topic. Each one runs in your browser.