Conversion Rules
Markdown Source
0 words · 0 chars
Drop your .md file here to import
Clean Plain Text (.txt)
0 words · 0 chars
Drop multiple .md or .markdown files here
Batch process dozens of documents at once. Convert all files directly in your browser with zero latency and export individual text files or a single ZIP archive.
Browse FilesConverted Queue
0 files| File Name | Original MD Size | Clean TXT Size | Words | Actions |
|---|
Automate via Terminal & Scripts
Need to convert hundreds of files in your local directory? Copy these ready-to-run scripts.
Python 3 Quick CLI Script (No extra packages required)
import re
import sys
from pathlib import Path
def md_to_txt(md_text):
text = md_text
# 1. Remove YAML frontmatter
text = re.sub(r'^---[\r\n]+[\s\S]*?[\r\n]+---[\r\n]*', '', text)
# 2. Strip images:  -> alt
text = re.sub(r'!\[([^\]]*)\]\([^)]+\)', r'\1', text)
# 3. Strip links: [text](url) -> text
text = re.sub(r'\[([^\]]+)\]\([^)]+\)', r'\1', text)
# 4. Strip inline formatting: bold, italic, code
text = re.sub(r'(\*\*|__)(.*?)\1', r'\2', text)
text = re.sub(r'(\*|_)(.*?)\1', r'\2', text)
text = re.sub(r'`([^`]+)`', r'\1', text)
# 5. Clean headers
text = re.sub(r'^#{1,6}\s+(.+)$', r'\1', text, flags=re.MULTILINE)
# 6. Clean list bullets
text = re.sub(r'^[\*\-\+]\s+', '• ', text, flags=re.MULTILINE)
return text.strip()
if __name__ == '__main__':
src = Path(sys.argv[1] if len(sys.argv) > 1 else 'README.md')
if src.is_dir():
for file in src.glob('**/*.md'):
out = file.with_suffix('.txt')
out.write_text(md_to_txt(file.read_text(encoding='utf-8')), encoding='utf-8')
print(f"Converted {file.name} -> {out.name}")
else:
out = src.with_suffix('.txt')
out.write_text(md_to_txt(src.read_text(encoding='utf-8')), encoding='utf-8')
print(f"Converted {src.name} -> {out.name}")
Bash / Pandoc One-liner
# Convert all .md files in the current folder to .txt using Pandoc
for f in *.md; do pandoc "$f" -t plain -o "${f%.md}.txt"; done