Skip to content
JustDevTools
  • JSON formatter and validator
    Format, minify and validate JSON, with the exact line and column of any syntax error.
  • JWT decoder
    Read a JWT's header and payload, with issued-at and expiry times shown as real dates.
  • Base64 encoder and decoder
    Encode and decode Base64 and Base64URL, with full Unicode support.
  • JSON to TypeScript, Zod and Java
    Paste a JSON response and get TypeScript interfaces, a Zod schema or Java classes with Jackson annotations.
  • YAML to JSON converter
    Convert YAML to JSON and JSON to YAML, with the exact line of any syntax error. Handles multi-document files.
  • Regex tester
    Test JavaScript regular expressions with live match highlighting, capture groups and replace preview.
  • URL encoder and decoder
    Percent-encode and decode URLs and query values, and break a URL into its parts and parameters.
  • Unix timestamp converter
    Convert Unix timestamps in seconds or milliseconds to dates, and dates back to timestamps.
  • Cron expression explainer
    See what a cron expression means in plain English, what each field does and the next times it will run.
  • JSON to CSV converter
    Turn a JSON array into CSV for Excel or Google Sheets, or a CSV file into JSON. Nested objects become columns.
  • UUID generator and inspector
    Generate UUID v4 and time-ordered v7 in bulk, or paste a UUID to see its version and timestamp.
  • Text diff checker
    Compare two texts line by line and see exactly what was added, removed or changed.
  • Hash and HMAC generator
    SHA-256, SHA-1, SHA-384 and SHA-512 hashes and HMAC signatures of text, in hex or Base64.
  • Markdown previewer
    Write Markdown on the left and see it rendered live on the right, with GitHub-style tables and task lists.

JSON to TypeScript, Zod and Java

Paste a JSON response and get TypeScript interfaces, a Zod schema or Java classes with Jackson annotations.

Runs locally. Nothing you paste leaves this tab.

TypeScript

export interface User {
  id: number;
  email: string;
  display_name: string;
  is_active: boolean;
  "created-at": string;
  address: Address;
  orders: Order[];
}

export interface Address {
  city: string;
  postal_code: string;
}

export interface Order {
  id: number;
  total: number | null;
  items: Item[];
  coupon?: string;
}

export interface Item {
  sku: string;
  qty: number;
  gift?: boolean;
}

Generate types from a real API response

Paste the JSON you get back from an API and this tool writes the matching types for you. Pick TypeScript interfaces for type checking, a Zod schema when you also want to validate responses at runtime, or Java classes with Jackson annotations for a Spring Boot client.

How arrays are handled

Real responses are rarely uniform. When an array contains several objects, the tool merges all of them instead of looking only at the first item:

  • A key that appears in some items but not others becomes optional (coupon?: string).
  • A key that is null in some items becomes nullable (total: number | null).
  • Whole numbers and decimals in the same field become number (or Double in Java).
  • An empty array becomes unknown[] because there is nothing to infer from. Paste a sample with data to get a real type.

The more varied your sample, the more accurate the result. If an endpoint is paginated, paste a page with several records rather than a single one.

Using the Zod output

Validate a response before you trust it:

const res = await fetch("/api/users/1042");
const user = UserSchema.parse(await res.json()); // throws if the shape changed
// user is fully typed as User

Use safeParse instead of parse if you want to handle a mismatch without an exception. Turn on .strict() if unexpected extra keys should count as errors.

Using the Java output

Records need Java 16 or newer and Jackson 2.12 or newer, which every current Spring Boot version includes. Keys that are not valid Java names, like created-at, get an @JsonProperty annotation so they still map correctly. Integers become Long because JSON numbers can exceed the range of int, and every type is boxed so a missing or null value doesn’t throw.

User user = restClient.get()
    .uri("/api/users/{id}", 1042)
    .retrieve()
    .body(User.class);

@JsonIgnoreProperties(ignoreUnknown = true) is added to every class, so new fields an API adds later won’t break deserialization.

Limitations

Types are inferred from the sample, not from an API specification. Dates stay as strings, and a field that is always null in your sample can’t be typed more precisely than null. If the API publishes an OpenAPI spec, treat that as the source of truth and use this tool for quick work and undocumented endpoints.