Utvikling · verktøy

Markdown til HTML-konverterer

Velg konverteringsretning, lim inn teksten og kopier eller last ned resultatet.

Kjøres i nettleseren. Ingen opplasting.
Safe preview

Om verktøyet

Markdown til HTML-konverterer sem complicação.

Konverter GitHub Flavored Markdown, inkludert tabeller, oppgavelister og gjennomstreking, til HTML, eller gjør HTML om til Markdown. Forhåndsvis resultatet i et sandkassemiljø som blokkerer skript og nettverksforespørsler. HTML-utdata renses før forhåndsvisning; konvertering og forhåndsvisning skjer lokalt.

Veiledning

Slik bruker du Markdown til HTML-konverterer

The Markdown and HTML Converter turns Markdown into HTML, or HTML back into Markdown, inside your browser. Markdown mode understands GitHub Flavored Markdown such as tables, task lists and strikethrough. Before you see the HTML, it is cleaned with DOMPurify, and a locked-down preview shows how it looks. It is a converter, not a full security filter.

Slik gjør du

  1. Pick a direction at the top: Markdown to HTML or HTML to Markdown. Paste your text into the input box, up to 500,000 characters.
  2. In Markdown mode, leave GitHub Flavored Markdown ticked if you use tables or task lists. Tick Turn line breaks into HTML breaks if every new line should become a line break.
  3. Press Convert. The result appears in the output box. In Markdown mode you can also open Safe preview to see the rendered result.
  4. Press Copy result to copy the text, or Download result to save converted.html or converted.md. Clear empties the boxes.

Eksempler

Markdown with a link and a task list

Du skriver inn
modus
Markdown to HTML
tekst
# Shopping Buy **milk** and [eggs](https://example.com). - [x] bread - [ ] jam
Du får
html
<p>Hello world <img src="x"> <a>bad</a></p>

The task list items become disabled checkboxes, one ticked and one empty. The link keeps its address because it starts with https.

Kjørt med verktøyets egen kode.

Markdown that contains unsafe HTML

Du skriver inn
modus
Markdown to HTML
tekst
Hello <script>alert(1)</script>world <img src=x onerror=alert(1)> [bad](javascript:alert(1))
Du får
html
<p>Hello world <img src="x"> <a>bad</a></p>

The script element and the onerror attribute are removed, and the javascript: link loses its address, so the link text is left without a target. The image tag stays, because images are allowed.

Kjørt med verktøyets egen kode.

HTML to Markdown

Du skriver inn
modus
HTML to Markdown
tekst
<h2>Plan</h2><p>Buy <b>milk</b> and <a href="https://example.com">eggs</a></p><ul><li>one</li><li>two</li></ul>
Du får
markdown
## Plan Buy **milk** and [eggs](https://example.com) - one - two

Headings use the hash style and list items use a dash. The list marker is followed by three spaces, which is how the converter library writes list items.

Kjørt med verktøyets egen kode.

An HTML table going back to Markdown

Du skriver inn
modus
HTML to Markdown
tekst
<table><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table>
Du får
markdown
a b 1 2

In this direction the table is not turned into a Markdown table. Each cell becomes its own paragraph, so you would need to rebuild the table by hand.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Turn a README or notes written in Markdown into HTML you can paste into a page or an email template.
  • Convert copied HTML from a web page into Markdown for a wiki or a notes app.
  • Preview how a table or a task list will render before you publish it.
  • Check which parts of pasted HTML get stripped by a sanitizer.

Begrensninger

  • Input is limited to 500,000 characters, and an empty box shows the message Paste text before converting.
  • The HTML is cleaned with DOMPurify's HTML profile. In tests it removed script, iframe, SVG and math elements, event-handler attributes and javascript: links, but it kept style elements, forms, inline style attributes and remote images.
  • Cleaning does not make the HTML right for every use. If you insert it into your own site, apply your own rules and security settings as well.
  • HTML to Markdown does not make Markdown tables or strikethrough. The result follows the default behavior of the Turndown library with hash headings and dash bullets.

Tips

  • If you only need a quick look, open Safe preview. It blocks scripts and removes link and image addresses, so what you see is not clickable.
  • Tick the line-break option only when your Markdown relies on single new lines, as in chat or poetry. Standard Markdown joins them into one paragraph.
  • After converting a table from HTML, rebuild it with pipes and dashes if you need a Markdown table.

Kilder

Vanlige spørsmål

Sobre Markdown til HTML-konverterer.

How do I convert Markdown to HTML?

Choose Markdown to HTML, paste your Markdown and press Convert. The HTML appears in the output box. Copy it or download it as converted.html. GitHub Flavored Markdown is switched on by default.

Is the HTML sanitized?

Yes. After conversion, the HTML is passed through DOMPurify with its HTML profile. In tests it dropped scripts and event attributes, but it left style elements, forms and remote images in place. Treat it as cleaned, not as a complete security check.

Does the preview run scripts or load links?

No. The preview sits in a sandboxed frame with a strict content policy, and the preview copy has link and image addresses removed. It is meant for looking at the layout only.

What is the line-break option for?

With it on, a single new line in your Markdown becomes a break tag. With it off, two lines in a row are joined into one paragraph, which is the usual Markdown behavior. The option only appears in Markdown mode.

Does HTML to Markdown clean the HTML too?

Yes. The HTML is cleaned with DOMPurify first, so scripts and event attributes disappear before the Markdown is made. Tables are not kept as tables, and each cell turns into a paragraph.

What is the difference between Markdown and GitHub Flavored Markdown?

GitHub Flavored Markdown adds a few extras to the basic rules, such as tables, task lists and strikethrough. If you untick the option, those extras are no longer converted and appear as plain text.

Is my text sent to a server?

No. The conversion, the cleaning and the preview happen in your browser. The tool only loads its own helper scripts from this site when you press Convert.

Hvordan bruker du Markdown- og HTML-konverterer?

Velg konverteringsretning, lim inn teksten og kopier eller last ned resultatet.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.