PlayWithJSON

Text to JSON Generator

Mock Data Parser

Write intuitive text schemas with built-in data types and modifiers to generate complex, structured mock JSON.

Text Schema Input
Insert:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Lines: 27Chars: 823
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
  "users": [
    {
      "id": "6278b113-aaee-43b1-a431-1a38b281c9f4",
      "name": "Pranav",
      "gender": "Male",
      "autoId": 1,
      "randomNumber": 83,
      "pickColor": "blue",
      "age": 28,
      "role": "Admin",
      "email": [
        "dev@example.com",
        "test@example.org"
      ],
      "address": {
        "city": "Noida",
        "state": "UP",
        "country": "India",
        "pincode": 201301
      },
      "orders": [
        {
          "orderId": 5001,
          "orderedAt": "2025-01-15 14:22:10",
          "amountINR": "₹2341.12",
          "amountUSD": "$193.98",
          "isDelivered": true
        },
        {
          "orderId": 5002,
          "orderedAt": "2025-01-15 14:22:10",
          "amountINR": "₹10803.83",
          "amountUSD": "$132.72",
          "isDelivered": false
        }
      ],
      "schedule": {
        "birthMonth": "September",
        "preferredDay": "Friday",
        "appointmentTime": "17:12:20",
        "registeredDate": "2023-04-18",
        "nextReview": "2026-08-25"
      }
    },
    {
      "id": "6a04cd23-c58b-4a5d-ab1e-46b05e4668c1",
      "name": "Suraj",
      "gender": "Female",
      "autoId": 2,
      "randomNumber": 74,
      "pickColor": "red",
      "age": 34,
      "role": "Designer",
      "email": [
        "dev@example.com",
        "test@example.org"
      ],
      "address": {
        "city": "Noida",
        "state": "UP",
        "country": "India",
        "pincode": 201304
      },
      "orders": [
        {
          "orderId": 5003,
          "orderedAt": "2025-01-15 14:22:10",
          "amountINR": "₹1257.14",
          "amountUSD": "$155.76",
          "isDelivered": true
        },
        {
          "orderId": 5004,
          "orderedAt": "2025-01-15 14:22:10",
          "amountINR": "₹2416.31",
          "amountUSD": "$83.59",
          "isDelivered": true
        }
      ],
      "schedule": {
        "birthMonth": "January",
        "preferredDay": "Tuesday",
        "appointmentTime": "22:26:55",
        "registeredDate": "2023-09-12",
        "nextReview": "2026-11-10"
      }
    }
  ]
}
Output Size: 2.1 KBLines: 90
Engine: playwithjsontxt2json

Text to JSON Generator & Mock Studio Online

Convert intuitive text syntax, shorthand schemas, and mock data templates into clean, structured JSON instantly with PlayWithJSON. Design mock payloads, realistic API responses, and database seed objects in seconds without manually typing JSON brackets and quotes.

Equipped with dynamic generators (@uuid, @name, @email, @random, @currency), array repeaters (users[5]), and smart type inference, our client-side generator provides a frictionless authoring experience for frontend and backend engineers.

{}

Why Use PlayWithJSON?

  • No manual JSON quoting or bracket wrestling
  • Smart mock tokens (@uuid, @name, @email, @city)
  • Array generators: items[5] { id, title }
  • Real-time live output with Tree & Raw views
  • 100% Free and runs privately in your browser

What Can You Do With Our Text to JSON Generator?

Shorthand Schema Syntax

Write simple key: value pairs without quote marks or trailing comma headaches.

Dynamic Mock Generators

Generate realistic UUIDs, names, emails, dates, and numbers with @tokens.

Array Multipliers

Instantly generate lists of 10, 50, or 100 mock objects using syntax like users[5].

Interactive Tree & Raw Views

Inspect generated structures in a collapsible tree or copy formatted raw code.

Instant Syntax Feedback

Get immediate notifications if indentation or schema definitions need fixing.

Export & Copy

Copy generated JSON or download .json files directly to seed your application.

How to Generate JSON from Text Online

1

Write Keys & Values

Type key: value pairs in the text input pane without worrying about JSON quotes.

2

Use Dynamic Tokens

Incorporate tokens like @uuid, @name, @email, or @boolean for realistic mock data.

3

Define Arrays & Nested Objects

Create lists with items[3] { ... } to generate multiple mock records instantly.

4

Copy or Download JSON

Copy the compiled JSON or download it for testing APIs and frontend components.

Text to JSON Compilation Example

Text Schema (Input)
user { id: @uuid name: "Alex Morgan" email: @email active: true }
Structured JSON (Output)
1{
2 "user": {
3 "id": "e4b2d18a-93a0-4f5a",
4 "name": "Alex Morgan",
5 "email": "alex.morgan@example.com",
6 "active": true
7 }
8}

Schema Validation Example

Unclosed Block Syntax
1users[3] {
2 id: @uuid
3 name: @name
4// missing closing brace
Syntax Error: Missing closing brace } for block "users"
Valid Shorthand Schema
1users[3] {
2 id: @uuid
3 name: @name
4}

Supported Schema & Token Features

Smart type inference (bool, number, null)
Array multipliers (items[5])
Nested blocks and sub-objects
@uuid - Unique identifier generator
@name, @firstName, @lastName
@email, @domain, @url generators
@country, @city, @address mock data
@currency, @price, @integer, @float
@timestamp, @date (past, future, now)
Interactive Cheat Sheet modal
Tree view node inspector
100% Client-side execution without tracking
Frequently Asked Questions

Frequently Asked Questions about Text to JSON

It is a developer tool that turns human-friendly shorthand schema text into strict, valid JSON. Instead of manually typing commas and quotes, you write concise key-value notation and smart mock tokens.

More JSON Developer Tools

View All Tools

JSON Formatter

Format, validate and inspect JSON data

JSON5 Formatter

Format and validate JSON5 with comments

JSON ↔ JSON5

Convert between JSON and modern JSON5

JSON to TypeScript

Generate TypeScript interfaces from JSON

JSON to Zod

Generate Zod schemas from JSON

Text to JSON

Convert text and schemas into structured JSON

JSON Sorter Online

Sort JSON keys alphabetically and order arrays

JWT Decoder Online

Decode JWT header, payload and expiration

JSON Stringify Online

Escape quotes and stringify or unescape JSON

Mock JSON Generator

Generate realistic mock data for APIs and testing

JSON to CSV

Export structured JSON arrays into CSV spreadsheets

JSONPath Tester

Query and filter JSON data with path expressions

JSON Schema Generator

Generate JSON Schema from sample JSON

JSON Diff & Compare

Compare two JSON objects and find differences

JSON ↔ YAML

Convert JSON/JSON5 to YAML and back with comments

JSON ↔ XML

Convert JSON to XML and XML to JSON with attributes

YAML to CSV

Convert YAML lists and objects into spreadsheets

CSV to JSON / JSON5

Convert CSV/TSV to JSON or JSON5 with type parsing

JSON to BigQuery

Generate BigQuery Schema JSON and CREATE TABLE DDL

JSON to GraphQL

Generate GraphQL SDL types, queries, and inputs

JSON to MySQL

Generate MySQL CREATE TABLE DDL and INSERT queries

JSON to PostgreSQL

Generate PostgreSQL CREATE TABLE DDL, JSONB and INSERTs

JSON Flattener

Flatten nested JSON to dot notation or unflatten back

JSON Tree Visualizer

Interactive SVG mindmap graph and collapsible node tree

JSON Minifier Online

Compact and compress JSON by stripping whitespace

JSON Token Counter

Calculate LLM tokens (GPT-4o, Claude) and API costs

Broken JSON Repair

Automatically heal broken and truncated AI/LLM JSON