Import / Export
Format conversion between Markdown, HTML, and more using the unified ecosystem. Test round-trip fidelity.
Try it
Edit the markdown on the left. See the HTML output, rendered preview, and round-tripped markdown (HTML → Markdown) to check conversion fidelity.
Markdown
remark-parse + remark-rehype
HTML
rehype-parse + rehype-remark
Markdown
Input Markdown
Round-Trip Analysis
Compare the original markdown with the round-tripped version (Markdown → HTML → Markdown). Differences indicate where format conversion loses information:
- GFM tables — generally round-trip well
- Task lists — may lose checkbox state in some converters
- Code blocks — language hints may be lost
- Emphasis nesting —
***bold italic***may become separate marks - HTML in markdown — raw HTML passes through but may be reformatted
Format Support
Markdown ↔ HTML
Full support via remark + rehype. Handles GFM, tables, task lists, code blocks.
SupportedDOCX → HTML
Via mammoth.js. Converts Word documents to clean HTML. Lossy but practical.
Library AvailableHTML → DOCX
Via html-docx-js or docx library. Generate Word files from HTML content.
Library AvailableMarkdown → PDF
Via md-to-pdf or browser print. Convert markdown to PDF documents.
Library AvailableCode
typescript
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkGfm from 'remark-gfm';
import remarkRehype from 'remark-rehype';
import remarkStringify from 'remark-stringify';
import rehypeParse from 'rehype-parse';
import rehypeRemark from 'rehype-remark';
import rehypeStringify from 'rehype-stringify';
// Markdown → HTML
const html = await unified()
.use(remarkParse).use(remarkGfm)
.use(remarkRehype).use(rehypeStringify)
.process(markdown);
// HTML → Markdown
const md = await unified()
.use(rehypeParse)
.use(rehypeRemark)
.use(remarkStringify)
.process(html);