HTML to JSX Converter

Convert HTML to JSX for React: attributes renamed, style strings turned into objects, SVG, comments, form values and event handlers converted. JSX or TSX.

Loading tool…

How it works

Paste HTML

A snippet or a whole page. A page converts what is inside <body>.

Pick JSX or TSX

Type a component name to get a function component instead of bare JSX.

Copy it

Read the notes above the code: they flag what needs a check.

Why className and htmlFor?

React uses the DOM property names: class is className, for is htmlFor, tabindex is tabIndex. data- and aria- attributes stay as written.

Source: React: common components

What happens to style="..."?

It becomes an object with camelCase keys: margin-top is marginTop, -webkit-transition is WebkitTransition, -ms-transform is msTransform.

Source: React: the style prop · React (legacy docs): style

Why defaultValue instead of value?

In React, value without onChange makes a field read-only. defaultValue and defaultChecked set the starting value, as the HTML did. A selected option becomes defaultValue on its select.

Source: React: <input> · React: <select> · React: <textarea>

What happens to onclick?

React event props take a function, not a string. onclick="go()" becomes onClick={() => { go() }}, with a note to check the names it uses.

Source: React: responding to events

Is my HTML uploaded?

No. It is parsed and converted in this tab. Scripts in it do not run and images do not load.

Building the UI with a coding agent?

Browser Harness lets Claude Code, Codex or Cursor open pages in your Chrome, logged in as you.