Start a project

Tool 270 of 450 · React

HTML to JSX Converter

Convert HTML into JSX: class to className, inline styles to objects, self-closing tags and event attributes.

HTML to JSX Converter

Your input

Result

JSX
ChangeCount

    01

    What it does

    Convert HTML into JSX: class to className, inline styles to objects, self-closing tags and event attributes.

    • class, for, tabindex and 60+ attribute renames
    • Inline style strings to style objects
    • Void tags self-closed, booleans kept
    • SVG attributes (stroke-width to strokeWidth, xlink:href …)

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    JSX component and a list of what changed, with a Copy and a Download button on every result.

    • React
    • JSX
    • HTML

    Why it matters

    Pasting HTML from a template or a design tool into React means fixing dozens of small things by hand, and missing one gives a warning in the console or a broken style.

    This parses the HTML properly (no regex), rewrites each element, and lists every change so you can review the result.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Convert. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    What happens to onclick="…"?

    It becomes onClick with the code wrapped in an arrow function, and it's flagged: in React you'd normally pass a function from your component instead.

    Why defaultValue instead of value?

    In React, value makes an input controlled, so it can't be typed in without an onChange handler. defaultValue keeps the HTML behaviour. Untick the option if you'll add state.

    Does it handle <script> and <style>?

    Their contents are kept as strings with a warning; in React they're usually moved into your bundle or CSS instead.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk