100% Local · Free · No Sign-up

Convert Plain Text (.txt) to Clean Markdown

A line scanner promotes the plain-text conventions that are unambiguous — setext underlines, bullet glyphs, 1) numbering, indented code blocks and bare URLs — and leaves your wording untouched. CRLF endings and a stray UTF-8 BOM are normalised on the way in, entirely inside your browser.
Drop your TXT file here to convert to MarkdownDrag & drop files here, or click anywhere to browse · .txt, .text · or paste text with Ctrl+V

Processing happens 100% in your browser — nothing is uploaded.

What stays as-is

Headings are only recognised from ===/--- underlines, so a bare title line stays a paragraph. ASCII-art tables are not rebuilt as GFM tables, hard-wrapped paragraphs are not reflowed, and Markdown special characters in your text are not escaped — all three require guessing at intent, and guessing wrong is worse than leaving the line alone.
100% Local Processing — Your files never leave your device

How to convert TXT to Markdown

  1. Input: drop a .txt or .text file onto the dropzone, or paste the text straight into the editor.
  2. Process: the scanner normalises line endings and promotes setext headings, list markers, indented code and bare URLs locally.
  3. Copy: copy the Markdown or download it as a .md file.

Why Convert TXT to Markdown with MD Convert?

  • Non-destructive by design

    No paragraph reflowing and no "short line in title case is probably a heading" guesswork. Rules that are right eighty percent of the time force you to audit every line, which costs more than adding a few # characters by hand.

  • Real structure where it already exists

    Lines underlined with === or --- become H1/H2, *, +, •, ‣ and · bullets become -, 1) becomes 1., and bare http(s) URLs become <autolinks>. Existing Markdown and fenced code passes through verbatim.

  • Indented blocks become fenced code

    Runs of tab- or four-space-indented lines are dedented and wrapped in triple backticks — but only after a blank line and only with two or more lines, so list continuation lines are never mistaken for code.

  • Encoding hygiene, done locally

    CRLF and lone CR endings are normalised to LF, a leading UTF-8 byte-order mark is stripped so a first-line heading still parses, and runs of blank lines collapse. Nothing is uploaded; the text is read and transformed in your tab.

TXT to Markdown: Before and After

Setext underlines become ATX headings, asterisk bullets become hyphens, `1)` becomes `1.`, the indented block becomes a fenced code block with the indent removed, and the bare URL becomes an autolink. Not one word of prose is rewritten.

Input · text
Release Notes
=============

Summary
-------

Parser shipped. See https://md-convert.org/txt-to-markdown for details.

* faster tokenizer
* fewer allocations

1) upgrade the package
2) re-run the build

    const x = compile(src);
    console.log(x.stats);
Output · Markdown
# Release Notes

## Summary

Parser shipped. See <https://md-convert.org/txt-to-markdown> for details.

- faster tokenizer
- fewer allocations

1. upgrade the package
2. re-run the build

```
const x = compile(src);
console.log(x.stats);
```

Understanding the TXT Format: RFC 2046 §4.1 (text/plain) + Unicode UTF-8

Format
Plain Text
Media type
text/plain; charset=utf-8
Parser used
Custom line scanner (no dependencies)

Technical Specifications & Line Promotion Rules

  • Setext Heading Promotion: Lines underlined with `===` promote to ATX `#` (H1) and lines with `---` promote to `##` (H2); un-underlined title-case lines remain plain paragraphs to prevent false-positive structural guesses.
  • Bullet & Numbered List Normalization: Diverse plain-text bullet markers (`*`, `+`, `•`, `‣`, `·`) convert to standard GFM `- ` list items; parenthesized numbers (`1)`) normalize to canonical `1.` syntax.
  • Indented Code Fencing & List-Continuation Guard: Multi-line blocks indented by four spaces or tabs convert to triple-backtick fenced blocks only when preceded by a blank line, preventing list continuation lines from misclassifying as code.
  • Encoding & Line-Ending Normalization: Automatically strips leading UTF-8 Byte Order Marks (BOM) to preserve first-line headings; normalizes Windows CRLF (`\r\n`) and legacy Mac CR (`\r`) to Unix LF (`\n`).
  • Non-Destructive Character Preservation: Hard-wrapped paragraphs and inline Markdown special characters (`_`, `*`, `|`) are preserved without automated reflowing or aggressive escaping, preventing address and code damage.

Developer Alternative: CLI (Pandoc) & Python Scripting

For batch pipelines or server-side automation, Pandoc and Python produce the same kind of Markdown outside the browser.

Bash (Pandoc)
# Convert plain text to Markdown using Pandoc (preserves CommonMark conventions)
pandoc -f markdown -t gfm input.txt -o output.md
Python (regex & utf-8-sig)
# Programmatic plain text to Markdown conversion in Python
import re

# utf-8-sig automatically strips leading BOM characters
with open("notes.txt", "r", encoding="utf-8-sig") as f:
    text = f.read()

# Normalize line endings and promote setext underlines to ATX headings
text = re.sub(r"\r\n|\r", "\n", text)
text = re.sub(r"^([^\n]+)\n={3,}$", r"# \1", text, flags=re.MULTILINE)
text = re.sub(r"^([^\n]+)\n-{3,}$", r"## \1", text, flags=re.MULTILINE)
print(text)

How You Can Verify the Privacy Claim

Browser-only

Zero server upload

Conversion runs inside your browser tab. Open DevTools, switch to the Network panel, and convert a file: for every format except URL to Markdown you will see no request carrying your document — because there is no endpoint to send it to.

Web Worker

Off the main thread

Heavy parsing is dispatched to a Web Worker, so a 500-page PDF or a large spreadsheet never freezes the interface. Everything is plain JavaScript — no native plugin, no WebAssembly toolchain, nothing to install.

No account

Nothing to sign up for

No login, no quota, no paywall, and no tracking tied to your files. Analytics are cookieless and aggregate only. Read the privacy policy for the full data-flow breakdown, including the one proxied exception.

The parsers doing the work

No proprietary black box: each format is handled by a widely audited open-source library, running client-side at the version pinned in our lockfile.

TXT to Markdown — FAQ

Why are my headings not detected?

Only setext-style headings are promoted: a line of text with === or --- directly underneath it becomes an H1 or H2. A bare title line carries no trustworthy signal — inferring from casing or length is wrong often enough that you would end up auditing every line. Add the # prefix for those, or put underlines in the source and re-convert.

Why did an indented line not become a fenced code block?

A run of lines indented with a tab or four or more spaces is dedented and wrapped in a ``` fence, but only when preceded by a blank line and containing at least two indented lines. That is what keeps a wrapped paragraph or a list continuation line — which belongs to its bullet — from being turned into a code block; add a blank line before an intentional code sample to ensure promotion.

Will my text be reflowed or reworded?

No. Wording, punctuation and line breaks inside paragraphs are preserved exactly. Hard-wrapped text stays hard-wrapped, because deciding which breaks were meaningful is not safe to automate — getting it wrong destroys addresses, verse and code listings. Markdown special characters in your text such as _, *, | and backticks are likewise not escaped, so a code-heavy file should be fenced before or after converting.

What about non-UTF-8 files and Windows line endings?

CRLF and classic Mac CR endings are normalised to LF, and a leading UTF-8 BOM is stripped — an invisible BOM otherwise pushes the # off the start of line one and breaks the first heading. Non-ASCII characters are decoded as UTF-8 by the browser, so accented and emoji content passes through unchanged. A legacy file saved in a single-byte codepage such as Windows-1252 may show replacement characters; re-save it as UTF-8 first.