CodeForge
  1. Developer tools
  2. JSON to TypeScript

JSON to TypeScript converter

Turn an API response into typed code in seconds. Paste a JSON sample and CodeForge infers the types — strings, numbers, booleans, arrays and nested objects — and writes the interface for you. Generation is offline and deterministic: no AI, no upload.

Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.

How to use it

  1. Open the JSON tool and paste a sample payload.
  2. Choose Convert → TypeScript, or another language with Pro.
  3. Copy the generated code into your project.

Example

JSON sample
{
  "id": 42,
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "active": true,
  "roles": ["admin", "editor"],
  "address": { "city": "London", "zip": "NW1" }
}
TypeScript (nested types: Pro)
interface Address {
  city: string;
  zip: string;
}

interface Root {
  id: number;
  name: string;
  email: string;
  active: boolean;
  roles: string[];
  address: Address;
}
Zod (Pro)
import { z } from 'zod';

export const AddressSchema = z.object({
  city: z.string(),
  zip: z.string(),
});
export type Address = z.infer<typeof AddressSchema>;
Go (Pro)
type Address struct {
	City string `json:"city"`
	Zip string `json:"zip"`
}

On the free plan you get the root interface, and nested objects are typed as unknown. Pro generates every nested type.

Features

Frequently asked questions

Is this JSON to TypeScript converter free?

Yes for the root type: the free plan generates a TypeScript or JavaScript definition for the top-level object, with nested objects typed as unknown. Pro generates every nested interface and adds nine more languages.

Does it use AI?

No. Code generation is a deterministic generator that runs on your device. Your JSON never leaves it and no AI credits are used.

Can I generate Zod or Pydantic models from JSON?

Yes, with Pro. Zod output includes inferred TypeScript types; Pydantic output produces BaseModel classes.

How are nested objects named?

Each nested object becomes its own type, named after its key in PascalCase — for example, address becomes Address.

Related tools

JSON FormatterFormat, validate and minify JSON.Case ConvertercamelCase, snake_case, kebab-case and more.JWT DecoderDecode tokens; verify and sign with Pro.cURL Builder & ParserBuild, parse and inspect HTTP requests.

One workspace for all of it

JSON to TypeScript is one of 18 developer tools in CodeForge — alongside a JSON formatter, JWT decoder, regex tester, UUID and hash generators, and more. Press Ctrl+K to jump to any of them.

Open JSON to TypeScript — free Get the Windows app

Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.