Your README reads well on the project page, but now the same content needs to live somewhere else: a documentation page, a simple project site, an announcement post. Copying the rendered text out of the browser loses the code blocks and mangles the tables. Rewriting it by hand in HTML is slow and error-prone. What you actually want is the Markdown rendered properly, once, into HTML you can take away.

That is exactly the job of the free Markdown to HTML Converter on Ovatly. It renders Markdown with the marked parser, sanitizes the result with DOMPurify, and hands you code that is safe to paste into a page. This guide covers the conversion, the wrapper the fragment still needs, and the handful of things that change along the way.

Contents

  • Quick answer
  • What the converter does to your README
  • How to convert a README, step by step
  • Worked example: a README opening, converted
  • Adding the page around the fragment
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Open the README in a text editor, copy its contents, and paste them into the Markdown to HTML Converter. Check the sanitized preview, then copy the HTML or download it as an .html file. The output is a clean fragment covering your headings, paragraphs, lists, code and tables. To make it a standalone page, wrap that fragment in your own page shell with a doctype, a head section and whatever styles you want. The converter does the rendering and the safety pass; the page itself is yours.

What the converter does to your README

Two things happen to your text, in order. First, the marked parser renders the Markdown into HTML following CommonMark-style rules. Headings become heading elements, emphasis becomes em and strong elements, code fences become pre and code blocks. A few GitHub-flavored features that READMEs rely on, notably tables and strikethrough, are supported as well.

Then DOMPurify sanitizes the rendered HTML. Script tags are stripped. Event-handler attributes such as onclick are stripped. Links pointing at javascript: URLs are stripped. HTML comments are removed. Any other raw HTML you mixed into the README is kept only where DOMPurify considers it safe.

For a README destined for a public page, that second step is the valuable one. You get HTML you can paste into a site without auditing every line for something executable, because the audit already happened.

One distinction worth knowing: this converter's job is the code itself. The Markdown Editor in the Developer tools section is a writing surface with an export. If you are authoring new content, use the editor; if you have a finished README and need its HTML, use this converter.

How to convert a README, step by step

  1. Open the README file in a text editor and copy the whole contents. Converting a file means pasting its text; there is no file upload, and nothing leaves your browser.
  2. Paste the text into the Markdown to HTML Converter.
  3. Read the sanitized preview. Check that headings nest sensibly, code blocks survived intact, and tables render as tables.
  4. Copy the sanitized HTML, or download it as an .html file if you would rather start from a file.
  5. Paste the fragment into your page shell, as described in the section after the worked example.
  6. Follow the relative links and image paths in the fragment and adjust any that pointed at locations relative to the repository, so they resolve on the page instead.

Worked example: a README opening, converted

Take the top of a typical README:

# Title

Some **bold** text.

The converter produces:

<h1>Title</h1>
<p>Some <strong>bold</strong> text.</p>

The same pattern holds all the way down the file. A ## Install section heading becomes an h2 element, hyphen or asterisk list items become a ul with li entries, and a fenced block of shell commands becomes a pre block wrapping a code element, with the code itself untouched. What you see in the preview is exactly the code you copy, because the preview shows the sanitized output, not the raw render.

Adding the page around the fragment

The downloaded or copied HTML is a fragment: content only, no document structure. A browser will display a bare fragment, but a real page needs a shell. At minimum, that means a doctype, an html element, a head with a title and character encoding, and a body holding your fragment:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Project Title</title>
</head>
<body>
<!-- Paste the converted fragment here -->
</body>
</html>

Add a viewport meta tag and a style block or stylesheet link if the page needs to look like anything more than browser defaults. None of that is the converter being incomplete. A fragment is the right output, because it drops just as cleanly into an existing site template, a CMS field or a static site layout as it does into a hand-written shell like the one above.

Limitations and honest tradeoffs

The converter does not style anything. Typography, spacing and colors come from the page you put the fragment into, and an unstyled page looks like 1995. Budget a few minutes for basic CSS if the page is public.

Sanitization cuts both ways. If your README deliberately embeds raw HTML for a special effect, some of it will be removed or neutralized, and there is no option to switch the safety pass off. For content headed to a web page, that trade is almost always worth it, but check the preview for gaps where embedded HTML used to be.

Relative paths are your responsibility. A README usually references screenshots and other files relative to the repository. Those references convert as written, and they will only work on the page if the files exist at the same relative locations there.

Common mistakes

  • Expecting a finished page. The output is a fragment. If you open the download expecting a styled document, add the shell first.
  • Pasting the file path instead of the file. The converter needs the README's contents. Open it in a text editor and copy the text itself.
  • Assuming embedded scripts survive. They are stripped on purpose. Anything interactive has to be added back in your own page code, outside the converted fragment.
  • Forgetting the images. Image syntax converts, but the files and their paths need the same attention they need in any move.
  • Using the writing tool for a conversion job. The Markdown Editor is for authoring. For a finished README, the converter is faster and gives you the sanitized code directly.

FAQs

Does the converter produce a complete web page? No. It produces the HTML for your content: the headings, paragraphs, lists and code from the README. That fragment still needs a page around it, with a doctype, a head section and any styles, before it is a standalone page.

Why did the script or raw HTML in my README disappear? Because the output is sanitized with DOMPurify. Script tags, event-handler attributes and javascript: URLs are stripped, HTML comments are removed, and other raw HTML is kept only where DOMPurify considers it safe. That is what makes the copied code safe to paste into a page.

How do I convert a .md file rather than pasted text? Open the README in a text editor, copy its contents, and paste them into the converter. When the HTML looks right in the preview, copy it or download it as an .html file.

Are tables and strikethrough supported? Yes. Rendering follows the marked parser with CommonMark-style rules, and a few GitHub-flavored features such as tables and strikethrough are supported too, which matters because READMEs use both heavily.

Is my README uploaded to a server? No. The conversion runs locally in your browser. Nothing is uploaded, which also means it works on private or unfinished documentation.

Conclusion

A README converts in one pass: paste it into the Markdown to HTML Converter, confirm the sanitized preview, and take the fragment away to dress in whatever page it is moving into. If your workflow runs in the opposite direction and an HTML draft needs to become Markdown worth publishing, our guide to cleaning up converted Markdown before publishing covers that side. For more guides in this series, see our Website and Webmaster Tools guides.

References