Skip to content

JSON to Delphi - Generate Delphi Pascal Classes

Generate Delphi/Object Pascal class definitions with published properties from JSON data.

Input

json
loading editor…

Paste your JSON data here...
or drop a file anywhere in this pane

Output

text

Generated Delphi code will appear here...
press to generate delphi code

What Is Delphi Object Pascal?

Delphi uses Object Pascal, a powerful object-oriented programming language with published properties that enable runtime type information (RTTI) for JSON serialization and IDE design-time support. Delphi developers often need class definitions that mirror JSON API responses for seamless data binding.

This tool is used for:

  • Delphi API Clients: Generate Delphi classes that map to JSON API responses for use with REST client libraries like RESTClient or NetHTTPClient.
  • Data Binding: Create published-property classes that integrate with Delphi's data-aware controls and LiveBindings for automatic UI updates.
  • Legacy System Integration: Quickly produce Delphi record or class definitions from JSON samples when connecting older Delphi applications to modern web APIs.

How to Use JSON to Delphi Online

  1. Paste your JSON data: Enter a JSON object or array that represents the data you want to work with in your Delphi application.
  2. Click Generate Delphi Code: The tool produces a complete Delphi class definition with published properties matching your JSON fields.
  3. Add to your Delphi project: Copy the generated unit into your Delphi project and use it with TJSON, TJSONObject, or a third-party library like SuperObject for deserialization.

Frequently Asked Questions

How do I deserialize JSON into the generated Delphi class?

You can use Delphi's built-in TJSON.JsonToObject from the System.JSON unit, or third-party libraries like SuperObject or mORMot. The published properties with RTTI attributes in the generated class ensure proper mapping during deserialization.

Is this tool safe?

Yes. All processing happens 100% client-side in your browser. Nothing is uploaded to any server.

Is this tool free?

Yes, completely free with no usage limits or registration required.

Real-World Examples

Delphi developers migrating from SOAP to REST-based services can generate typed classes from sample JSON responses produced by modern web APIs. This eliminates the tedious and error-prone process of manually declaring classes with published properties, especially for APIs with complex nested objects and arrays.

Related Tools

  • JSON to VBA — Generate VBA class modules from JSON data
  • JSON to C# — Generate C# class definitions from JSON data
  • JSON to Python — Convert JSON to Python dictionary and variable definitions