JSON to Form Generator
Turn a JSON list of fields into form code in one of four skins: plain HTML5, Tailwind CSS JSX, Bootstrap 5 HTML or a typed React component. Pick the skin, paste the JSON, copy or download the code. Runs in your browser; nothing is uploaded.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Plain HTML5 markup with native validation attributes and generic class names (form-group, checkbox-label, radio-label) you style yourself. Downloads as form.html.
JSON Schema Reference
Define your form structure using the following JSON schema:
{
"formId": "string",
"formClass": "string",
"method": "GET" | "POST",
"action": "/submit-url",
"submitText": "Submit",
"fields": [
{
"name": "fieldName",
"type": "text|email|number|...",
"label": "Field Label",
"placeholder": "Placeholder text",
"required": true,
"options": [{ "value": "", "label": "" }]
}
]
}Supported field types: text, email, number, tel, url, password, textarea, select, checkbox, radio, date, time, datetime-local, file
How to Generate a Form from JSON
-
Pick an output skin
Choose HTML, Tailwind, Bootstrap or React above the editor. The choice is kept in the address bar as ?skin=, so a link opens the same skin. -
Paste or load the JSON
Paste an object with a fields array, or press Load Sample. Each field needs name, type and label; add placeholder, required, options, rows, min, max or the other supported properties as needed. -
Add the skin's own options
Top-level keys shared by all skins are method, action and submitText. HTML also reads formId and formClass, Bootstrap reads formId, layout and a per-field helpText, React reads componentName, useHooks and a per-field defaultValue. -
Copy or download the code
The code updates as you type. Copy it to the clipboard or download it as a file, then wire it to your backend.
Common Use Cases
Scaffolding contact and sign-up forms
Forms stored as data
Comparing stacks
Teaching form markup
Why Generate Form Code from JSON?
The JSON to Form Generator turns a JSON object that lists form fields into form code, in the output skin you pick: HTML, Tailwind, Bootstrap or React. Every skin reads the same field format: an object with a fields array, where each field has a name, a type and a label, plus optional placeholder, required, options for selects and radio groups, and rows for textareas. Field types are text, email, number, tel, url, password, textarea, select, checkbox, radio, date, time, datetime-local and file.
The HTML skin writes plain HTML5 with label/for pairs and native validation attributes (required, min, max, minlength, maxlength, pattern, accept), wrapped in generic classes you style yourself. The Tailwind skin writes JSX with Tailwind utility classes, so it pastes into a React, Next.js or Astro component. The Bootstrap skin writes Bootstrap 5 HTML with form-control, form-select and form-check, in a vertical, horizontal (two columns from the md breakpoint) or floating-label layout, with optional help text under a field. The React skin writes a TypeScript component with a typed state object, one change handler and an async submit handler that posts JSON to your action URL.
The code is generated in your browser tab and nothing is uploaded. To go the other way, the Form to JSON Schema tool reads an existing HTML form, and the JSON Schema Form Builder lets you build the field list by pointing and clicking. The same four generators are also callable from code: see the JSON to HTML Form API reference.
How it compares
Visual form builders such as Google Forms or Typeform host the form for you and keep it inside their service. Snippet tools and Emmet in an editor save keystrokes but still leave you writing each field. This page sits between them: you describe the fields as data and get source code you own and host yourself, in the markup style of your stack. It does not host forms, collect submissions or validate on a server; the output is the front-end markup, and handling what it posts is up to your backend.
Tips for Better Results
- Use the same name values your backend expects, so the generated form posts the field names you already handle.
- Mark mandatory fields with required: true; every skin turns it into the native required attribute and marks the label with an asterisk (checkbox labels excepted).
- Give select fields a first option with an empty value, so a required select cannot be submitted untouched.
- In the Bootstrap skin, floating labels apply to text, email, password, tel, url and textarea fields; other types fall back to the stacked layout.
- The Tailwind skin's classes follow the pattern used with the official @tailwindcss/forms plugin; add that plugin if inputs render without a border.
- Test the generated form in your own page before shipping it; the output is a starting point, not a finished design.