Text and dataRuns in your browser

GraphQL Formatter for Documents and Operations

Make a GraphQL document easier to review while preserving comments, strings, block strings, and fragment spreads.

  • Queries and mutations
  • Fragments and directives
  • No schema fetch
Online tool

Try the tool

Add your data, choose the settings, and get the result.

GraphQL document

Formatted document

—

The formatter checks bounded lexical structure and balanced delimiters while preserving comments, strings, and block strings. It does not validate against a GraphQL schema or execute the operation.

Your data stays here

Text and selected files are processed in the current browser and are not sent to a server to produce the result.

Reviewed: 2026-07-17
01

How to use it

  1. 1

    Paste a GraphQL document.

  2. 2

    Choose the indentation size and run the formatter.

  3. 3

    Review the structure and copy the formatted document.

02

What the tool can do

  • Operation definitions, variables, arguments, and directives.
  • Selection sets, aliases, fragments, inline fragments, and type conditions.
  • Comments, escaped strings, and triple-quoted block strings.
  • Checks for matching braces, parentheses, and brackets.
03

Common use cases

  • Preparing a query for a pull request or documentation.
  • Reviewing a compact GraphQL payload copied from logs.
  • Catching obviously unbalanced delimiters before debugging.
04

How it works inside

Input is limited to 500,000 characters, 20,000 tokens, and depth 64.

Commas are treated as insignificant GraphQL tokens and are not required in the output.

05

Questions and answers

Is the query checked against my schema?

No. Schema introspection and remote endpoint access are outside the formatter's scope.

Can it format fragments and block strings?

Yes. The formatter preserves fragment spreads, comments, regular strings, and triple-quoted strings within its bounded lexical parser.