---
title: "HTML to JSX Converter: React JSX and TSX"
description: "Free HTML to JSX converter: paste HTML, get React JSX or TSX. className, style objects, SVG attributes, form defaults and onClick handlers done. No upload."
canonical: "https://browser-use.com/tools/html-to-jsx"
last_updated: "2026-11-23"
---

# HTML to JSX Converter: React JSX and TSX

## 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.

## 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](https://react.dev/reference/react-dom/components/common)

### 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](https://react.dev/reference/react-dom/components/common#applying-css-styles) · [React (legacy docs): style](https://legacy.reactjs.org/docs/dom-elements.html#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>](https://react.dev/reference/react-dom/components/input) · [React: <select>](https://react.dev/reference/react-dom/components/select) · [React: <textarea>](https://react.dev/reference/react-dom/components/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](https://react.dev/learn/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.

[See Browser Harness](https://browser-use.com/browser-harness)

HTML

Output

JSXTSX

Component name (optional)

Load exampleClear

---

BROWSER USE

- Browser Use Agents: give Browser Use a task and receive completed work. API V4 is current for new integrations.
- Browser Infrastructure: connect your agent or automation to managed browsers through SDK, REST, or CDP. Starts at $0.06/browser-hour.
- Developer tools: Open Source, Browser Harness, SDK, and MCP support the two products above.

[Developer Index](https://browser-use.com/index.md)
[Product Map](https://browser-use.com/llms.txt)
[Full Product Context](https://browser-use.com/llms-full.txt)
[Pricing](https://browser-use.com/pricing.md)
[Cloud Docs](https://docs.browser-use.com/cloud/quickstart)
[Open Source Docs](https://docs.browser-use.com/open-source/introduction)
