Web Tools
GraphQL Formatter
Format and minify GraphQL queries, mutations, subscriptions, and schema definitions. Tokenizer-based formatting with proper indentation, comment preservation, and operation statistics. Runs entirely in your browser — your data never leaves your machine.
graphql formatter minifier query schema api
Published May 30, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste a GraphQL query, mutation, subscription, or schema definition and instantly format it with proper indentation or minify it for network efficiency. The tool uses a tokenizer-based approach to handle all GraphQL syntax.
Features
- Format mode: proper indentation with 2-space indent, one field per line
- Minify mode: strip all whitespace and comments for minimal payload size
- Full syntax support: queries, mutations, subscriptions, fragments, type definitions, enums, unions, interfaces, directives
- Comment preservation:
#comments are preserved in format mode, stripped in minify mode - Block strings:
"""..."""descriptions handled correctly - Statistics: operation count, field count, fragment count, size reduction percentage
- 5 examples: simple query, variables, mutation, schema definition, fragment usage
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Formatting GraphQL queries copied from logs or network inspectors
- Minifying GraphQL queries before embedding in production code
- Cleaning up auto-generated GraphQL schemas for documentation
- Quickly inspecting the structure of complex GraphQL operations