Text to Markdown
Convert plain text to Markdown in your browser. Recovers headings, lists and links, rejoins hard-wrapped paragraphs, and counts the tokens before you paste it into an AI model.
- ProcessingOn your device
- Uploaded to a serverNothing
- InternetNot needed
Don't take our word for it. Turn off your Wi‑Fi, then use this tool. It will work exactly the same, which is only possible because your file never goes anywhere.
Worth knowing
Structure detection is a set of educated guesses, not magic — plain text carries no markup to read. Headings come from capitals, ==== underlines and numbered sections, which is right on most documents and occasionally over-eager on one that uses capitals for emphasis. Every rule has its own switch, and the counts under the output tell you what it decided.
Token counts are estimates at roughly four characters per token. That is the right ballpark across current models but varies by tokeniser, so treat it as a guide rather than a bill.
What conversion actually means here
Renaming a .txt file to .md takes two seconds and changes nothing. The file extension is not what makes something Markdown — the syntax is. A renamed file still has bullet characters instead of list markers, sentences in capitals instead of headings, and paragraphs broken into a dozen separate lines. Open it in any Markdown renderer and it looks exactly as unstructured as it did before.
What this tool does is reconstruct the structure a plain-text file implies but never marks up. That is a guessing game, and being honest about that is the point: plain text carries no information about what is a heading and what is a shouted sentence. Every rule is a separate switch, and the counts under the output show you what it decided so you can tell when it guessed wrong.
The hard-wrapping problem
This is the one that catches everyone. Text files, email exports and anything that has passed through a terminal are usually wrapped at 72 or 80 characters — a line break inserted every few words purely so the text fits an old display. Markdown treats consecutive lines as one paragraph, so those breaks vanish and the paragraph reflows correctly. But plenty of converters preserve them as hard breaks, and you end up with a ragged column of fragments.
Distinguishing a wrapped paragraph from genuinely separate short lines — an address, a list of names, a signature block — is done by measuring. A block wrapped at column 72 has lines that all land near 72 characters; an address block has short, uneven ones. Comparing the average line length separates the two without needing to know the original wrap width.
Where the headings come from
- A line in CAPITALS with no closing punctuation — the classic plain-text heading.
- A line underlined with ==== or ---- directly beneath it, which becomes a level one or two heading.
- Numbered sections such as 1. Introduction or 2.3 Scope, where the depth of the numbering sets the heading level.
The rule that over-fires most often is the capitals one, because people also use capitals for emphasis. If a sentence in the middle of a paragraph gets promoted to a heading, switch heading detection off and add the two or three you want by hand — faster than fighting the heuristic.
Why anyone converts text for an AI model
Markdown is the format language models handle best, because the structure is explicit rather than implied by layout. A heading marked with a hash is unambiguously a heading; a heading that is merely larger text is something the model has to infer. Giving it explicit structure measurably improves how well it follows a long document.
The token counter under the output exists for the same reason. Plain text is dramatically cheaper to send than the same content as a PDF or a screenshot, because those get processed as images as well as text. If your content is already in a PDF, use PDF to Markdown instead, which does the same job starting from the document — and there is a fuller explanation of the cost difference in why feeding PDFs straight to ChatGPT costs more than it should.
What it will not do
It cannot recover structure that was never expressed. If your text is one continuous block with no capitals, no blank lines and no bullets, there is nothing to detect and you will get one long paragraph back — correctly. It also does not convert between Markdown flavours, and it will not extract text from a document: for that, start with PDF to Text and bring the result back here.
Everything runs inside this page. There is no upload step, no server, and no copy of your text anywhere but your own browser — turn off your network connection and the tool still works.
Questions people ask
Why does my text turn into one long line in Markdown?
Because it was hard-wrapped. Plain text files usually break lines at 72 or 80 characters, and Markdown treats a single line break as part of the same paragraph — so the wrapping disappears and the words run together. That is exactly what the Rejoin wrapped lines switch fixes: it detects a wrapped block by its consistently long lines and joins it back into one paragraph, while leaving genuinely short lines like an address block alone.
Will it recognise my headings?
Usually. It looks for three patterns people actually type: a line in CAPITALS with no full stop, a line underlined with ==== or ----, and numbered sections like 1. Introduction or 2.3 Scope. What it cannot do is read intent — a line of capitals used for emphasis mid-paragraph may be promoted by mistake. Check the Headings count under the output, and switch the rule off if it guessed wrong.
Is this different from just renaming .txt to .md?
Yes, and that is the whole point. Renaming changes nothing about the content: your bullets stay as bullet characters, your headings stay as ordinary sentences, and your wrapped paragraphs stay broken. This rebuilds the structure so a Markdown renderer, Notion, Obsidian or a language model actually sees headings as headings and lists as lists.
Why does it show a token count?
Because a lot of people convert text specifically to paste it into ChatGPT or Claude, and the size decides what it costs. Markdown is plain text, so it is far cheaper than the same content as a PDF or a screenshot — those get processed as images as well. Seeing the number before you paste is the difference between a cheap question and an expensive one.
Does my text get uploaded anywhere?
No. The conversion runs in JavaScript inside this page — there is no server involved and nothing is transmitted. You can disconnect from the internet and it still works, which is the simplest proof there is.