HTML to JSX

className, htmlFor, object styles, comments, and void tags. Great for pasting HTML templates into React components.

{{ t("htmlToJsxHint") }}

{{ htmlToJsx.message }}

Overview

React expects JSX: `class` becomes `className`, attributes like `for` and `tabindex` become camelCase (`htmlFor`, `tabIndex`), inline styles move to `style={{...}}`, and HTML comments become `{/* ... */}`. Void tags (`img`, `input`, `br`, …) are self-closed.

Conversion is heuristic: templates with `<script>`, complex SVG, or `dangerouslySetInnerHTML` need manual review. It is not a full React parser.

Sample

<div class="box" tabindex="0">
  <img src="/a.png" alt="">
  <!-- ok -->
</div>

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.