JSON Converter

Paste JSON and turn it into a Laravel array, a TypeScript interface, a PHP DTO, or CSV. Conversion runs in the page, so the data stays on your machine.

Runs entirely in your browser. Nothing you paste or upload is sent to a server.

What is JSON Converter?

A JSON converter reads a payload and prints it in another shape you can paste into a project. This page can write a Laravel array, a TypeScript interface, a PHP class with public properties, or CSV when the input is a list of objects. If the payload does not parse, fix it in the JSON formatter before you convert it.

TypeScript and the PHP class are drafted from the first object. A later row with an extra field is not added to that draft. CSV keeps top-level keys only, so a nested object stays one cell. Check the output before you commit it.

How to use it

  1. Paste a JSON object or array.
  2. Pick Laravel, TypeScript, PHP DTO, or CSV.
  3. Review the result, then copy or download it.

Useful for

  • Export a JSON array as CSV
  • Generate a Laravel array from JSON
  • Draft a TypeScript interface or PHP DTO

Example

This is the sample already loaded on the page. Laravel is the mode selected when the page opens. The same JSON can also become CSV, a TypeScript interface, or a PHP DTO.

[
  {"id": 1, "name": "Ada", "role": "engineer", "meta": {"active": true}},
  {"id": 2, "name": "Linus", "role": "founder", "meta": {"active": false}}
]
[
    [
        'id' => 1,
        'name' => 'Ada',
        'role' => 'engineer',
        'meta' => [
            'active' => true,
        ],
    ],
    [
        'id' => 2,
        'name' => 'Linus',
        'role' => 'founder',
        'meta' => [
            'active' => false,
        ],
    ],
]

Common mistakes

  • A trailing comma, or text wrapped in single quotes, is not valid JSON. The page shows the parse error and leaves the output empty.
  • CSV keeps only the top-level keys. The meta object becomes one cell, {"active":true}, rather than its own columns.
  • TypeScript and the PHP DTO read the first object in an array. A later row with an extra field is left out of the result.

Related guides

Related tools

Questions about JSON Converter

Which output formats are supported? +

Laravel PHP arrays, TypeScript interfaces, PHP DTO classes, and CSV (for array-of-objects JSON).

Does conversion require an API call? +

No. Conversion is pure client-side JavaScript for privacy and speed.

How do I convert JSON to a TypeScript interface? +

Paste a JSON object, or an array of objects, and choose TypeScript. The interface is drafted from the first object.

How do I turn JSON into a Laravel array? +

Paste the JSON and choose Laravel. The output uses PHP array syntax you can copy into a config, a test, or a seeder.

Does CSV keep nested objects? +

No. CSV uses the top-level keys. A nested object is written as one cell, not as extra columns.