HTML to JSX

Convert static HTML locally into JSX usable by React, Preact, or Solid, and report dangerous content that was removed.

Local browser processing
This page has passed the public directory check; full functionality is available after enabling JavaScript.
User Guide

How to use HTML to JSX

HTML is parsed and converted only in the current browser; it will not be uploaded, and scripts within it will not be executed.

  1. Select JSX target

    Select React, Preact, or Solid, and enter static HTML no more than 2 MiB.

  2. Run conversion

    The tool converts class, for, style, boolean attributes, empty elements, and common SVG attributes, and escapes text curly braces.

  3. Check security report

    Check the output and the counts of removed tags, event attributes, and dangerous URL, then copy or download JSX.

Limitations and Notes

  • This is not a full browser HTML repair tool. Severely malformed input, or input that depends on DOM state or template directives, must be cleaned up manually.
  • script, style, iframe, object, embed, event attributes, and dangerous URL will be removed, and the original page behavior will not be preserved.
  • Only React, Preact, or Solid JSX are generated; Vue and Svelte components are not generated, and components are not automatically split or resources imported.

FAQ

How are inline styles converted?

Common CSS declarations are converted to JSX style objects; declarations that cannot be reliably parsed must be corrected manually in the output.

Why did the scripts and iframe disappear?

This content may execute code or load external pages; the tool proactively removes it at the safety boundary for static-structure conversion.

Can the output be used directly in production?

It should first go through project formatting, type checking, and browser testing, with special attention to custom attributes, SVG, and framework differences.

Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback