Free online tools to generate, calculate,
convert, format, encode, and play.
 

GraphQL Query Formatter

Format, beautify, and minify GraphQL queries, mutations, and subscriptions. Instantly prettify your GraphQL with proper indentation.


Drop a .graphql or .gql file here or
The result updates as you type.
Size: -
Lines: -
Fields: -
Depth: -

How It Works

This tool tokenizes your GraphQL input and reformats it with proper indentation and consistent style. All processing happens entirely in your browser — no data is sent to any server.

  • Format — parses the GraphQL and re-indents it with consistent spacing, placing each field on its own line
  • Minify — collapses all whitespace to produce the most compact representation
  • Sort Fields — alphabetically sorts field names within each selection set while preserving structure
  • Syntax Highlighting — the output uses color-coded highlighting for keywords, types, fields, strings, directives, and comments

About GraphQL

GraphQL is a query language for APIs and a runtime for executing those queries. Developed by Facebook in 2012 and open-sourced in 2015, it provides a more efficient and flexible alternative to REST APIs by allowing clients to request exactly the data they need.

GraphQL Operations

  • Query — read data from the server (analogous to GET in REST)
  • Mutation — modify data on the server (analogous to POST/PUT/DELETE in REST)
  • Subscription — receive real-time updates when data changes
  • Fragment — reusable units of fields that can be shared across operations

Common Use Cases

  • API Development — designing and testing GraphQL schemas and resolvers
  • Debugging — formatting minified queries from network logs for readability
  • Documentation — cleaning up queries for use in API docs and examples
  • Code Review — standardizing query formatting across a codebase

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with