GraphQL Formatter
100% LocalBeautify and minify GraphQL queries, mutations, and schemas.
Privacy note
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.
How to Use GraphQL Formatter
Paste GraphQL
Enter a GraphQL query, mutation, or schema definition.
Format
Click Format to prettify the GraphQL with proper indentation.
Copy
Copy the formatted output.
GraphQL Formatter: the essentials
The GraphQL Formatter reflows queries, mutations, subscriptions, and SDL schemas into consistent indentation, or minifies them for embedding in code. Handles whitespace-collapsed copy/pastes from logs, network tabs, or chat messages where the original formatting was lost.
Key points
- Reflows graphql formatter into clean, readable output with standard indentation and keyword casing.
- Runs entirely in your browser, so production data never leaves your device.
- Supports multiple dialects and syntax variants for broad compatibility.
Learn More
What is GraphQL Formatter?
Frequently Asked Questions
Technical Deep Dive
GraphQL Formatter
Format messy GraphQL into clean, indented code or minify for production. Handles queries, mutations, subscriptions, and type definitions. Includes example presets for common GraphQL patterns.
Reliable Formatting
Idempotent, spec-compliant output, run it twice, get the same result.
Configurable Style
Indentation, quote style, and edge-case handling tunable to your team's conventions.
Big Inputs, Fast
Handles megabytes of code without freezing the tab, heavy lifting runs in workers.
01 Node Specification Matrix
| Node Type | Standard Indent | Parent Bracing | Comment Preservation |
|---|---|---|---|
| Operation | 2 Spaces | Same Line { | Above Block |
| Field | Depth N + 1 | Flat | Trailing / Above |
| Argument | Depth N + 1 | Multi-line if 3+ | Inline |
| Directive | Flat | Inline | Inline |