Ready to format
Paste GraphQL and click Format// format & beautify graphql in one click
Format and beautify GraphQL queries, mutations, and schemas instantly. Free browser-based tool — no sign-up, no upload, works offline.
Ready to format
Paste GraphQL and click FormatPaste your query, mutation, subscription, or schema into the input box.
Select Prettify or Minify, then pick your preferred indent size.
Click FORMAT, then copy the result or download as a .graphql file.
The GraphQL Formatter is a free, browser-based tool that instantly prettifies or minifies any GraphQL document — queries, mutations, subscriptions, and SDL schemas. No server upload, no account needed. Everything runs locally in your browser.
No. All formatting is done entirely in your browser using JavaScript. Your code never leaves your device, making this tool safe for proprietary or sensitive schemas.
Yes. The formatter handles GraphQL Schema Definition Language (SDL), including type definitions, interfaces, unions, enums, input types, and directives — not just queries and mutations.
You can choose 2 spaces, 4 spaces, or a tab character for indentation. The default is 2 spaces, which matches most GraphQL style guides and prettier defaults.
Yes. The formatter parses your GraphQL document before formatting. If it finds a syntax error, it will display a clear error message with the location so you can fix it quickly.
Absolutely. Switch to Minify mode to collapse your GraphQL into a single line, removing all unnecessary whitespace and comments. This is useful when embedding queries in HTTP request bodies.
Yes. The formatter correctly handles named fragments, inline fragments, variables, directives, and aliases — all valid GraphQL document syntax is supported.
A GraphQL Formatter is a developer tool that takes raw or minified GraphQL documents and restructures them into clean, consistently indented, human-readable code. Whether you're working with queries, mutations, subscriptions, or full SDL schema definitions, a formatter ensures your GraphQL follows a predictable style — improving collaboration, code review, and long-term maintainability.
GraphQL code can quickly become hard to read, especially when it's auto-generated, copy-pasted from documentation, or compacted for use in HTTP payloads. The JLV DevTools GraphQL Formatter solves this in one click, running entirely in the browser with zero data sent to any server.
Formatting GraphQL consistently matters for several reasons. First, it improves readability. A deeply nested query with selections, arguments, and directives becomes exponentially harder to understand without proper indentation. Second, it enforces team consistency — when everyone uses the same formatter, diffs in version control become clean and meaningful rather than noisy whitespace changes. Third, a well-formatted schema is easier to audit for security issues, redundant fields, and naming inconsistencies.
On the flip side, minification reduces GraphQL queries to a single line, which is useful when embedding queries in API calls, storing in environment variables, or reducing payload size in HTTP requests.
Under the hood, this tool uses a pure JavaScript GraphQL parser that implements the official GraphQL specification. When you click FORMAT, the tool:
If the parser encounters a syntax error — a missing brace, an unclosed string, an invalid field name — it immediately shows you the error with the line and column number so you can fix it fast.
The formatter offers two primary modes:
This tool handles the full GraphQL document specification, including:
@include, @skip, @deprecated, and custom directives.type, interface, union, enum, input, scalar), schema definitions, and extend statements.Here are some common situations where a GraphQL formatter saves time:
In REST APIs, requests are typically short URLs with a few parameters. In GraphQL, a single request can contain a highly complex nested document with dozens of fields, fragments, and directives. This complexity makes formatting critical — an unformatted GraphQL query is often completely unreadable, even to experienced developers. A good formatter is an essential part of any GraphQL developer's toolkit, alongside tools like GraphiQL, Apollo Studio, or Insomnia.
Unlike many online formatters that process code server-side, the JLV DevTools GraphQL Formatter runs entirely in your browser. Your GraphQL code — which may contain sensitive field names, type structures, or business logic — is never transmitted over the network. It stays on your machine at all times, making this tool safe for use with internal or proprietary schemas.