Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master them — home row to !@#$%Practice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM level
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & mission
Pricing
Start Typing
Tools/JSON Typing

JSON Typing Practice

JSON syntax rules, all six data types, real-world patterns, and the most common mistakes developers make — with typing practice links.

JSON Data Types

JSON supports exactly six value types — nothing more, nothing less.

TypeExampleDescription
string"Hello, World!"Sequence of Unicode characters in double quotes
number42 | 3.14 | -7 | 1e10Integer or floating-point — no distinction
booleantrue | falseLowercase literals only (not True/False)
nullnullExplicit absence of a value
array[1, "two", true, null]Ordered list of values of any type
object{"key": "value"}Unordered collection of key-value pairs

JSON Syntax Rules

  • ✓ Keys must be strings enclosed in double quotes
  • ✓ Key-value pairs are separated by a colon :
  • ✓ Pairs in an object are separated by commas
  • ✓ Arrays use square brackets []; objects use curly braces {}
  • ✓ Whitespace (spaces, tabs, newlines) outside strings is ignored
  • ✗ No trailing commas — ever
  • ✗ No comments — JSON is data, not code
  • ✗ No single quotes — always double quotes

Common JSON Mistakes

Trailing comma— JSON is strict — no trailing commas allowed

Wrong

{"a": 1, "b": 2,}

Correct

{"a": 1, "b": 2}
Single quotes— Both keys and strings must use double quotes

Wrong

{'key': 'value'}

Correct

{"key": "value"}
Unquoted keys— Keys must always be quoted strings

Wrong

{name: 'Alice'}

Correct

{"name": "Alice"}
Comments— JSON does not support comments of any kind

Wrong

// This is JSON
{}

Correct

{}
Undefined value— undefined is a JavaScript concept, not valid JSON

Wrong

{"x": undefined}

Correct

{"x": null}
Functions / regex— JSON is data-only — no functions or regex literals

Wrong

{"fn": function(){}}

Correct

{"fn": null}
NaN / Infinity— NaN and Infinity are not valid JSON numbers

Wrong

{"n": NaN}

Correct

{"n": null}
Unescaped newline— Newlines inside strings must be escaped as \n

Wrong

{"text": "line1
line2"}

Correct

{"text": "line1\nline2"}

Real-World JSON Patterns

These are the JSON structures you encounter every day as a developer. Type them until the structure feels natural.

REST API Response

{
  "status": "success",
  "data": {
    "id": 12345,
    "username": "saurav_dev",
    "email": "dev@example.com",
    "created_at": "2024-01-15T09:30:00Z",
    "is_pro": true,
    "stats": {
      "wpm": 87,
      "accuracy": 97.3,
      "tests_completed": 142
    }
  },
  "meta": {
    "request_id": "req_8f2a4d",
    "duration_ms": 48
  }
}

package.json (Node.js)

{
  "name": "my-app",
  "version": "1.0.0",
  "description": "A Next.js application",
  "main": "index.js",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "^14.2.0",
    "react": "^18.3.0",
    "react-dom": "^18.3.0"
  },
  "devDependencies": {
    "typescript": "^5.4.0",
    "@types/react": "^18.3.0",
    "tailwindcss": "^3.4.0"
  }
}

App Config File

{
  "app": {
    "name": "CodeSpeedTest",
    "version": "2.1.0",
    "environment": "production",
    "debug": false
  },
  "database": {
    "host": "db.example.com",
    "port": 5432,
    "name": "codespeedtest_prod",
    "pool_size": 10,
    "ssl": true
  },
  "features": {
    "ai_suggestions": true,
    "leaderboard": true,
    "certificates": true,
    "race_mode": false
  },
  "limits": {
    "free_tests_per_day": 10,
    "max_wpm_record": 300,
    "snippet_max_length": 2000
  }
}

Array of Objects

{
  "languages": [
    {
      "id": 1,
      "name": "Python",
      "slug": "python",
      "paradigm": ["object-oriented", "functional", "procedural"],
      "typing": "dynamic",
      "popular": true
    },
    {
      "id": 2,
      "name": "TypeScript",
      "slug": "typescript",
      "paradigm": ["object-oriented", "functional"],
      "typing": "static",
      "popular": true
    },
    {
      "id": 3,
      "name": "Rust",
      "slug": "rust",
      "paradigm": ["systems", "functional"],
      "typing": "static",
      "popular": false
    }
  ],
  "total": 3,
  "page": 1
}

Deeply Nested Object

{
  "user": {
    "profile": {
      "personal": {
        "name": "Alice",
        "age": 28
      },
      "professional": {
        "role": "Senior Engineer",
        "company": {
          "name": "Acme Corp",
          "size": "enterprise",
          "location": {
            "city": "San Francisco",
            "country": "US"
          }
        }
      }
    },
    "preferences": {
      "theme": "dark",
      "notifications": {
        "email": true,
        "push": false,
        "sms": false
      }
    }
  }
}

Practice typing these in CodeSpeedTest →

JSON is the lingua franca of the web. API responses, config files, package manifests — typing JSON quickly and accurately is a core developer skill. Start typing real code now.

Take the coding speed test →Browse all languages
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Resources

Pro ⚡ PricingCertifyFAQBlogContactLeaderboardRaceChallengesFree ToolsWPM CalculatorPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.