Transcode
Docs
InputJSON
OutputGraphQL

JSON to GraphQL

Format and minify JSON, or convert it to YAML, CSV, XML, TypeScript, Zod, JSON Schema, GraphQL, SQL and more.

Paste your input on the left and press Translate (or Ctrl/Cmd + Enter) to get the result on the right. Free, no sign-up.

Example

Input
{
    "id": 42,
    "name": "Ada Lovelace",
    "email": "ada@example.com",
    "active": true,
    "score": 98.5,
    "tags": ["math", "computing"],
    "address": {
        "city": "London",
        "zip": "W1"
    }
}
Output
type Address {
  city: String
  zip: String
}

type AutogeneratedMainType {
  id: Int
  name: String
  email: String
  active: Boolean
  score: Float
  address: Address
  tags: [String]
}

Frequently asked questions

How do I generate types from JSON?
Paste a sample object and choose TypeScript, Zod Schema or JSON Schema. The tool infers a type from the values it sees, so use a representative sample.
Why does my JSON fail to convert?
Most failures come from trailing commas, single quotes or unquoted keys. JSON requires double quotes and no trailing commas.
Is my JSON uploaded?
No. JSON conversions run in your browser.