JSON to TypeScript types

An API answer in, types for your code out.

  • Free, no sign-up
  • Nothing is uploaded
  • No daily limit
Files

    How to use JSON to TypeScript

    1. Type or paste into the boxes on this page.

    2. The result appears as you type, and changes when you do.

    3. Press JSON to TypeScript, then copy or download the result.

    What you get

    • interface or type
    • Nested objects get their own names
    • Arrays of mixed objects merged

    What to know first

    • Types come from one sample: a field that is sometimes missing or of another type there will not show it.

    Questions

    How are null values typed?

    As null, since that is all the sample shows. Change it to the real type, such as string | null.

    Can I name the root type?

    Yes, such as Product.

    Is my file uploaded?

    No. The page loads the converter into your browser and your device does the work. Run a tool once, switch off the internet and run it again: it still works. The page’s security rules also stop it from connecting to any other site.

    Is it free? Is there a limit?

    Free, with no sign-up, no watermark and no daily limit. The limit is your device’s memory, because the work happens there.

    More Codes and small tools

    Make and read QR codes and barcodes, check a file’s hash, format JSON, make passwords, convert 3D files. Free, on your device.

    See all Codes and small tools · Every tool