About the GraphQL Formatter playground

The GraphQL Formatter beautifies queries, mutations, subscriptions, and schema definitions into clean, consistently indented documents. It aligns selection sets, indents nested fields, and normalizes spacing around arguments, directives, and braces so complex operations are easy to scan. Because it works entirely in your browser, your operations and schema, which can reveal internal API shapes, are never uploaded to any server.

GraphQL is a query language and runtime for APIs that lets clients request exactly the fields they need from a typed schema. Operations describe nested selection sets, often with arguments, variables, fragments, and directives, which become hard to read when written on one line. Formatting restores the indentation that mirrors the shape of the requested data, making queries easier to review, share, and debug, and helping teams keep a consistent style across a schema.

HostedGraphQL Formatter runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • graphql.org— Official website
  • GitHub— Official spec repository

Messy input

query($id:ID!){user(id:$id){id name posts(first:5){title}}}

Formatted output

query ($id: ID!) {
  user(id: $id) {
    id
    name
    posts(first: 5) {
      title
    }
  }
}

Mutation with fragment

mutation AddPost($input: PostInput!) {
  addPost(input: $input) {
    ...PostFields
  }
}

fragment PostFields on Post {
  id
  title
}

Subscription formatted

subscription OnComment($postId: ID!) {
  commentAdded(postId: $postId) {
    id
    author
    text
  }
}

Schema (SDL) messy input

type Query{user(id:ID!):User posts:[Post!]!}type User{id:ID!name:String!email:String}

Schema (SDL) formatted output

type Query {
  user(id: ID!): User
  posts: [Post!]!
}

type User {
  id: ID!
  name: String!
  email: String
}

Query with directives and aliases

query ($withEmail: Boolean!) {
  primary: user(id: "1") {
    name
    email @include(if: $withEmail)
  }
}

Inline fragment messy input

query{search(q:"x"){__typename ... on User{name} ... on Post{title}}}

Inline fragment formatted output

query {
  search(q: "x") {
    __typename
    ... on User {
      name
    }
    ... on Post {
      title
    }
  }
}

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

What it does

Paste a query, mutation, subscription or schema and it beautifies the document.

Selection sets are aligned and nested fields are indented to mirror the data shape.

Spacing around arguments, directives and braces is normalized.

Formatting behavior

Handles variables, fragments and directives in complex operations.

Makes single-line operations easy to scan and review.

Keeps a consistent style across queries and schema definitions.

Privacy

Works entirely in your browser, so operations are never uploaded.

Schema details that reveal internal API shapes stay on your machine.

Tips

Copy the formatted operation to share or paste into your client.

Great for tidying ad-hoc queries before saving them.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It reformats GraphQL queries, mutations, subscriptions, and schema definitions into clean, indented documents with aligned selection sets and consistent spacing.
No. The formatter runs entirely in your browser, so your operations and schema definitions never leave your device.
Yes, it is completely free with no account and no usage limits.
Yes. You can choose the indent size or use tabs so the formatted output matches your team's conventions.
Yes. It handles client operations like queries and mutations as well as Schema Definition Language with types, fields, and directives.
Input
Output

Output

Start typing to auto-process

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup