---
title: "Transforms: Sort Keys and Reshape Data | Prettify Docs"
description: Sort keys alphabetically, format Markdown with Prettier, and build
  jq queries with the visual Transform Wizard. Sort and format are free.
url: https://prettify.tools/docs/transforms
---

[Docs](https://prettify.tools/docs) / Editing tools

# Transforms

Last updated: October 16, 2026

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.

1. Load a document.
2. 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.

```json
{ "name": "Ada", "age": 36, "active": true }
```

After Sort Keys:

```json
{ "active": true, "age": 36, "name": "Ada" }
```

## Format

Format rewrites Markdown and MDX with Prettier, so spacing, lists, and tables follow one consistent style.

1. Load a Markdown or MDX document.
2. 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](https://prettify.tools/docs/pro); see [jq queries](https://prettify.tools/docs/jq).

## Query transforms (Pro)

The query tools transform data and apply the result back to the document.

- [jq queries](https://prettify.tools/docs/jq) filter and transform JSON, JSONL, and YAML.
- [SQL queries](https://prettify.tools/docs/sql) run SELECT statements over CSV.
- [XPath queries](https://prettify.tools/docs/xpath) select nodes from XML.

Each query tool is a Pro feature. Free users get one try of each Pro tool per day.

## Related

- [Format conversion](https://prettify.tools/docs/conversion)
- [Generate types from JSON](https://prettify.tools/docs/type-generation)
- [Views: Tree, Table, Raw, and More](https://prettify.tools/docs/views)

## Try it online

Tool pages for this topic. Each one runs in your browser.

- [JSON Formatter](https://prettify.tools/json-formatter)
- [Markdown Formatter](https://prettify.tools/markdown-formatter)
- [jq Playground](https://prettify.tools/jq-playground)

* [PreviousFormat conversion](https://prettify.tools/docs/conversion)
* [Next Type generation](https://prettify.tools/docs/type-generation)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
