PixNudge

JSON to TypeScript Interface Generator

Generate TypeScript interfaces or types from JSON. Nested objects become named interfaces, and optional and nullable fields are detected from your data.

Input
TypeScript

How it works

  1. 1

    Paste or open your data

    Paste text, drop a file onto the editor or click Open file. Load sample shows how the tool works.

  2. 2

    Adjust the options

    The result updates as you type. Change the options to get exactly the output you need.

  3. 3

    Copy or download

    Copy the result to the clipboard or download it as a file.

Why PixNudge

Nothing is uploaded

Your data is processed in your browser and never sent to a server, so API keys, tokens and customer data stay private.

Instant, even for large files

There is no round trip to a server: results appear as you type, and files of several megabytes are handled smoothly.

Exact numbers

Long numbers such as 64-bit IDs are kept exactly as written instead of being rounded.

Frequently asked questions

How are optional fields detected?

If you paste an array of objects, keys that are missing from some items are marked optional (?), and values that are sometimes null are typed as a union with null. The more sample data you paste, the more accurate the types are.

Can I get type aliases instead of interfaces?

Yes. Interfaces are generated by default; turn on Use type aliases to get type declarations instead.

What does Types only mean?

With Types only on, you get just the type declarations. Turn it off to also generate functions that convert and check JSON at runtime.

More free tools