GraphQL Formatter & Beautifier
Prettify or minify GraphQL queries, mutations, and fragments online. No external packages — runs entirely in your browser.
GraphQL Formatter & Beautifier
The GraphQL Formatter instantly prettifies or minifies any GraphQL query, mutation, subscription, or fragment. It adds consistent 2-space indentation, places each field on its own line, and preserves comments, string literals, and arguments exactly.
Features
- Pretty-print with 2-space indentation
- Minify to a single line for network payloads
- Detects unbalanced braces before formatting
- Handles inline fragments, aliases, arguments, and directives
- Preserves
#line comments and block string literals - 100% client-side — your queries never leave the browser
When to minify
Minified GraphQL queries reduce payload size in HTTP requests and can improve performance when sending queries as URL parameters (GET requests). Use pretty-print for readability during development and code reviews.