FlipMyFormat

TXT to PDF Converter

Turn .txt, .log, code and other text files into clean PDFs. Pick the font, page size, line numbers and page numbers. Free, with no sign-up.

Select TXT files

.txt, .log, .md, .csv, code files · up to 20

The text is laid out on our server and deleted right after.

People also use

How to convert TXT to PDF

To turn a text file into a PDF, add your .txt file to the box above or paste the text, pick a font and a page size, and press Convert to PDF. A clean PDF comes back in a few seconds, with your lines, spaces and line breaks exactly as they were in the file.

It works with plain text of every kind: notes from Notepad, .log files, Markdown, CSV and JSON data, subtitles in .srt, and source code in Python, JavaScript, Java, C and more. You can add up to 20 files of up to 20 MB each, and get one PDF per file or all of them in one PDF.

  1. 1

    Add your text

    Tap Select TXT files or drop files on the box. You can also paste or type text in the box next to it. Up to 20 files at a time.

  2. 2

    Choose font and page

    Pick Monospace, Sans or Serif, a size from 8 to 16 pt, a page size such as A4 or Letter, and the margins.

  3. 3

    Add numbers if you want

    Turn on line numbers for code and logs. Page numbers in the style Page 1 of 9 are on by default.

  4. 4

    Convert and download

    Press Convert to PDF. Download one PDF, or a ZIP with one PDF for each file.

The defaults suit most files: Monospace at 10 pt on A4, normal margins and page numbers. For a quick result, add the file and press Convert to PDF. On a computer, Ctrl+Enter starts it too when you are not typing in the text box.

Why turn a text file into a PDF?

A text file is the simplest kind of document, but it does not always look the same everywhere. Different apps use different fonts, wrap lines in different places and may show strange symbols when the encoding is guessed wrong. A phone may not open a .log or .md file at all, and many upload portals accept only PDF.

A PDF fixes all of that. The font, the page size, the line breaks and the numbering are set once, and every reader sees the same pages on a computer, a tablet or a phone. It prints the same way too, page for page, so a printed copy matches what you saw on the screen.

A PDF is also easier to share and file. One PDF can hold many text files, it can carry page numbers and the file name on every page, and it can be locked with a password later. The text inside stays real text, so it can still be searched and copied.

TXT to PDF converter free, with no sign-up

This is a txt to pdf converter free for everyone. There is no account to create, no trial and no email address to give. You open the page, add your text and download the PDF.

Free does not mean cut down. Every option on the page is open to you: three fonts, seven text sizes, four page sizes, three margin widths, line numbers, page numbers, a file name header, landscape pages, line spacing, tab width and text encoding. You can convert up to 20 files in one go and join them into a single PDF.

The PDF you get is a real text PDF, not a picture of your text. You can select words, copy them and search the file with Ctrl+F in any PDF reader. Nothing is added to your pages: no watermark, no logo and no extra page.

TXT to PDF online free, on any device

Many people look for txt to pdf online free because they are on a shared or work computer where they cannot install programs. This page is made for that. It runs in the browser, so it works in Chrome, Edge, Firefox and Safari on Windows, Mac, Linux, Chromebook, Android and iPhone.

Your file is read in your browser first. The page works out the encoding, so letters such as é, ü and ñ come out right, and builds a document with your settings. That document is then sent to our server, where LibreOffice lays out the pages and makes the PDF. The files are deleted right after the job is done.

Your settings are remembered in your browser. Next time you open the page, the same font, page size and options are already picked, so a repeat job takes just a couple of clicks.

Notepad to PDF: save a text file from Windows

Notes from Windows Notepad are plain .txt files, so a notepad to pdf conversion is the most common job on this page. Add the .txt file, keep the defaults and press Convert to PDF. The lines come out exactly as you see them in Notepad, with blank lines and spaces kept.

Older Notepad files are often saved in Windows ANSI rather than UTF-8. Leave Text encoding on Auto: it checks for a byte order mark, then tries UTF-8, and if that fails it reads the file as Windows ANSI. So accented letters, the euro sign and curly quotes from old files still show correctly.

Windows can also print from Notepad to Microsoft Print to PDF. That is fine for one quick file. But you get no line numbers, no footer in the style Page 1 of 9 and only one file at a time. Here you can do all of that at once, and pick the font and page size just for the PDF.

Which settings should I use?

Font

Monospace (Liberation Mono) gives every character the same width, so columns and code line up. Sans (Liberation Sans) looks like Arial and Serif (Liberation Serif) looks like Times, for letters and notes.

Text size

Choose 8, 9, 10, 11, 12, 14 or 16 pt. 10 pt suits most files. Use 8 or 9 pt to fit long lines, and 12 pt or more for easy reading.

Page size and margins

A4, Letter, Legal or A5, with narrow, normal or wide margins. Narrow margins fit more text on each page.

Line numbers

Numbers every line down the left side, empty lines too. Handy for code, logs and anything people will discuss line by line.

Page numbers

Adds Page 1 of 9 at the bottom of every page. It is on by default; untick it for a clean page.

Orientation and line spacing

Landscape gives wide logs and tables more room. Line spacing can be 1.0, 1.15, 1.5 or 2.0.

Header

Puts the file name at the top of each page, so printed pages from many files never get mixed up.

Text encoding and tab width

Encoding is Auto by default, or UTF-8, Windows (ANSI) or UTF-16 by hand. Tabs become 2, 4 or 8 spaces.

Fonts and text size: what to pick

The font you pick changes how your PDF reads. Monospace is the default because most text files are written with it in mind: code, logs, tables made with spaces and old README files all expect every letter to take the same width. With Monospace, a column that lines up in Notepad lines up in the PDF.

Sans and Serif are better for normal writing, such as letters, essays, stories and meeting notes. They fit more words on each line and feel more like a printed page. Sans is clean and modern, close to Arial. Serif is close to Times and suits long reading.

Text size goes from 8 to 16 pt. Smaller sizes fit long lines and long files on fewer pages; larger sizes are easier on the eyes and good for people who print and read on paper. If you are not sure, keep 10 pt, then try 11 or 12 pt for writing and 9 pt for code.

TXT to PDF A4 size, or Letter, Legal and A5

A4 is the default page size, because it is the standard paper in India, the UK, Europe and most of the world. If you need txt to pdf a4 size for a school, office or government upload, you do not have to change anything: the PDF pages are 21 x 29.7 cm.

Page sizes you can choose
Page sizeMeasuresGood for
A421 x 29.7 cm (8.27 x 11.69 in)Most countries, offices, schools
Letter8.5 x 11 in (21.59 x 27.94 cm)USA and Canada
Legal8.5 x 14 in (21.59 x 35.56 cm)US legal paper, very long files
A514.8 x 21 cm (5.83 x 8.27 in)Small booklets, reading on a phone

Margins are 2 cm on every side with Normal, 1.27 cm with Narrow and 3 cm with Wide. When page numbers, the file name header or line numbers are on, the page is adjusted so they fit without covering your text.

Switch to landscape when lines are long. A landscape A4 page fits about half again as many characters on each line as a portrait one, which stops log lines and wide tables from wrapping as often.

TXT to PDF with line numbers

Tick Line numbers and every line of your text gets a number in the left margin, from 1 to the end of the file. Empty lines are counted too, and the count runs on across pages instead of starting again at 1. So line 240 in the PDF is line 240 in your editor.

That is what makes txt to pdf with line numbers useful for code reviews, log checks, transcripts and class notes. People can point to an exact line on paper or in a call, and everyone finds the same spot.

Line numbers work with every font and page size, but they look tidiest with Monospace. Page numbers are separate: they appear in the footer as Page 1 of 9, and you can keep both on together. To number the pages of a PDF you already have, use Add Page Numbers.

Multiple TXT files to one PDF

When you add two or more files, a Files option appears. Choose All in one PDF to join multiple txt files to one pdf, in the order you added them. Choose One PDF per file to get a separate PDF for each, downloaded together in one ZIP.

Turn on the file name header in More options when you join files. Then every page shows which file it came from, which helps a lot when the PDF is printed or shared.

You can add up to 20 files at a time, each up to 20 MB, and you can paste text as well. Pasted text is added as one more document. To join PDFs you already have, use Merge PDF.

Code to PDF: indentation kept exactly

Source code needs every space in its place. Here, runs of spaces are kept exactly, and tabs are turned into spaces at the width you pick: 2, 4 or 8. So code to pdf keeps your indentation, nested blocks and aligned comments as they are in your editor.

Use Monospace so each character has the same width, turn on line numbers and pick 9 or 10 pt. Python, JavaScript, TypeScript, Java, C, C++, C#, Go, PHP, SQL, HTML, CSS and shell scripts are accepted, and so are data and config files such as JSON, XML, YAML and INI.

The PDF shows the code as plain text in one colour. That keeps it clean for printing and easy to read on paper, and the text stays selectable, so anyone can copy a line back out of the PDF.

Log file to PDF: long lines and big files

Server logs, app logs and error reports are plain text, so a log file to pdf conversion works the same as any .txt file. Files up to 20 MB are accepted, which is many thousands of lines.

Log lines are often long. Choose Landscape (wide logs) in More options, Monospace at 8 or 9 pt and narrow margins to fit more on each line. Lines that are still too long wrap onto the next line, so nothing is cut off.

Turn on line numbers so you can point to the exact entry when you share the PDF with a colleague or a support team. The text in the PDF stays searchable, so Ctrl+F finds an error code or a time stamp in seconds.

Hindi text to PDF and other languages

Text in Hindi and other Indian scripts often turns into empty boxes when a converter has no font for it. Here, Hindi, Arabic, Bengali, Tamil and Chinese text get a matching font automatically, so a hindi text to pdf conversion comes out with the letters joined and shaped properly.

You can mix languages in one file, such as English notes with Hindi lines, and each part gets a suitable font. Save the file as UTF-8, which is the default in Notepad on Windows 10 and 11, and leave the encoding on Auto.

You can also paste text straight into the box, for example from a chat or a web page, and the characters arrive as they are. The PDF keeps the real text, so it can be searched and copied later. To get text out of a photo or scan first, use Image to Text.

Markdown, CSV, JSON and subtitle files

Any file that is plain text inside can be turned into a PDF here, whatever its ending. Markdown (.md) files are shown as they are written, so headings with # and lists with - or * stay as plain characters. That is handy when you want to print or share the source of a README exactly.

CSV and TSV files keep their commas and tabs, one row per line. JSON, XML and YAML keep their indentation, so nested data stays easy to follow. Subtitle files in .srt keep their numbers, time codes and lines of dialogue in order, which makes a simple script to read or check.

Config files, SQL scripts, batch and shell scripts work the same way. If your file opens in Notepad or TextEdit and looks like text, it will work here. Word, PDF and image files are not plain text, so they need a different tool.

Strange letters? Text encoding explained

A text file is just a row of bytes, and the encoding says which letter each byte stands for. Most files today are UTF-8. Older Windows files are often Windows ANSI, also called Windows-1252, and some programs save UTF-16.

On Auto, the page looks for a byte order mark first, then checks whether the file is valid UTF-8, and if it is not, reads it as Windows ANSI. This gets nearly every file right without you doing anything.

If letters still look wrong, for example é shown as é, open More options and pick UTF-8, Windows (ANSI) or UTF-16 by hand. The file is read again straight away with the new setting, before you convert.

TXT to PDF on Mac, iPhone and Android

For txt to pdf on mac, open this page in Safari, Chrome or Firefox, drag your .txt file onto the box and press Convert to PDF. Files from TextEdit work too, as long as they are saved as plain text rather than rich text (Format > Make Plain Text).

Mac

TextEdit can make a PDF with File > Export as PDF. This page adds line numbers, page numbers, A4 or Letter pages and many files at once.

Windows

Notepad can print to Microsoft Print to PDF, one file at a time. Here you can convert up to 20 files and join them.

iPhone and iPad

Open this page in Safari, tap Select TXT files and pick a file from the Files app, or paste text from any app.

Android

Open this page in Chrome, tap Select TXT files and choose the file from your phone, or paste text from a note or chat.

On a phone, pasting is often the quickest way. Copy text from a note, an email or a chat, paste it in the box and press Convert to PDF. The finished PDF can then be saved or shared like any other download.

Print menu or this page?

Your computer can already make a PDF from a text file through its print menu. Here is when that is enough, and when this page helps more.

What you wantNotepad or TextEdit printThis page
Line numbersNot availableYes, one tick
Many files at onceOne file at a timeUp to 20 files, joined or separate
A4, Letter, Legal or A5In the print settingsOne click on the page
Hindi and other scriptsDepends on the fonts you haveMatching font picked automatically
Works on a phoneNot easy from a text editorYes, in the browser
Needs internetNoYes, the PDF is made on our server

For one short note on a computer, the print menu is fine. For numbers, many files, phones or other scripts, use this page.

Printing your text the right way

Most text PDFs end up printed at some point. For a clean print, keep the page size the same as your paper: A4 in most of the world, Letter in the USA and Canada. If they do not match, the printer has to shrink or enlarge the pages and the text size changes.

Normal margins leave room for staples and binding. Choose Wide margins if you want to write notes beside the text, and Narrow margins when you want to save paper. Page numbers help to keep printed pages in order if they get dropped or mixed up.

For double-sided printing, landscape pages and long files, the file name header is useful too: every sheet then shows which file it belongs to. Because the text in the PDF is real text, it stays sharp at any size, on screen and on paper.

Plain text or Word document?

A .txt file holds only letters, numbers and line breaks. It has no bold, no colours, no pictures and no page layout. That is why it opens anywhere, and why the PDF needs you to pick a font and a page size: the file does not carry them.

A Word document is different. It already has its own fonts, headings, tables and pictures, so it needs a converter that keeps that layout. If your file ends in .doc or .docx, use Word to PDF instead, and this page will point you there if you add one by mistake.

If you have a PDF and want plain text back, the opposite direction is just as simple: PDF to Text pulls the text out of a PDF into a .txt file you can edit.

Common uses

School and college work

Turn assignment notes or a typed answer into an A4 PDF with page numbers, ready for a portal that only takes PDF.

Code for review or submission

Print source code with line numbers so teachers or teammates can comment on exact lines.

Logs for support tickets

Send a log as a PDF that opens on any device and stays searchable.

Notes and lists

Keep Notepad notes, recipes or to-do lists as tidy PDFs that look the same everywhere.

Subtitles and transcripts

Turn .srt subtitle files or meeting transcripts into PDFs for reading or printing.

Data files

Keep a printable copy of CSV, JSON or XML data exactly as it is in the file.

Is it safe?

Your text is used only to make your PDF. The page reads the file in your browser and sends the prepared document to our server, where LibreOffice lays it out. The files are deleted right after the job, and the finished PDF is there only for you to download.

There is no sign-up, so the job is not linked to an account or an email address. For private text, you can add a password to the finished PDF with Protect PDF.

How it works

First, your browser reads each file and works out its encoding. Then it builds a document with the font, size, page, margins, numbers and header you picked, keeping every space and line break.

Our server opens that document in LibreOffice, which lays out the lines on pages with the Liberation fonts, uses matching fonts for other scripts, and exports a PDF. If you chose All in one PDF, the files are joined into one. The PDF comes back to your browser, and the copies on the server are deleted.

Common problems and fixes

Letters look wrong (é instead of é)

Open More options and set Text encoding to UTF-8 or Windows (ANSI) by hand. The file is read again at once.

Columns do not line up

Use the Monospace font. In Sans and Serif, letters have different widths, so spaces cannot line things up.

Long lines wrap

Choose Landscape, a smaller size such as 8 pt and narrow margins. Wrapped lines are kept, never cut.

Indentation looks too wide

Change Tab width to 2 or 4 in More options.

My Word file is refused

This page is for plain text. For .doc and .docx files, use Word to PDF.

A file is too big

Each file can be up to 20 MB. Split a huge log into parts, or remove the lines you do not need first.

The PDF is too large to send

Text PDFs are usually small, but if you joined many files, Compress PDF can make it smaller.

I need the text back from a PDF

Use PDF to Text to pull plain text out of any PDF.

Tips for clean, readable PDFs

Use Monospace for anything with columns, code or text drawn with characters, and Sans or Serif for letters, essays and notes.

For print, 10 or 11 pt with normal margins is easy to read. For reading on a phone, try A5 at 10 pt.

Turn on the file name header when you join many files, so each page shows where it came from.

If a file has very long lines, try Landscape before making the text tiny.

Pasted text keeps its line breaks, so you can tidy it in the box before you press Convert to PDF.

What to do with your PDF next

Need a smaller file for email? Use Compress PDF. Want to put your new PDF together with other PDFs, such as a cover page or a scanned form? Use Merge PDF.

To lock the PDF with a password, use Protect PDF. If you have an e-book rather than plain text, EPUB to PDF turns it into a PDF in the same simple way.

Frequently asked questions

Is this txt to pdf converter free?

Yes. It is free, with no sign-up and no watermark. All options, including line numbers and joining files, are free to use.

How do I convert a TXT file to PDF?

Add the file or paste the text, choose the font and page size, and press Convert to PDF. Then download the PDF.

Can I do txt to pdf online free without installing anything?

Yes. It works in any modern browser on Windows, Mac, Linux, Chromebook, Android and iPhone. There is nothing to install.

How do I convert Notepad to PDF?

Save your note as a .txt file, add it here and press Convert to PDF. Your lines, blank lines and spaces are kept exactly.

Does Hindi text to PDF work properly?

Yes. Hindi, Arabic, Bengali, Tamil and Chinese text get a matching font automatically, so the letters are shaped correctly instead of showing as boxes.

Can I get txt to pdf with line numbers?

Yes. Tick Line numbers. Every line is numbered in the left margin, empty lines included, and the count runs on across pages.

How do I combine multiple txt files to one pdf?

Add up to 20 files, then choose All in one PDF under Files. They are joined in the order you added them.

How do I convert txt to pdf on mac?

Open this page in Safari, Chrome or Firefox, drag in the .txt file and press Convert to PDF. TextEdit files must be saved as plain text.

Can I make txt to pdf a4 size?

Yes. A4 is the default. You can also pick Letter, Legal or A5, in portrait or landscape.

Can I convert code to pdf and keep the indentation?

Yes. Spaces are kept exactly and tabs become 2, 4 or 8 spaces. Use Monospace and line numbers for the clearest result.

How do I convert a log file to pdf?

Add the .log file like any text file. For long lines, choose Landscape, Monospace at 8 or 9 pt and narrow margins.

Which file types can I add?

Plain text files such as .txt, .log, .md, .csv, .tsv, .json, .xml, .yaml, .ini, .sql and .srt, and code files like .py, .js, .java, .c and .html. You can also paste text.

Is there a limit on files or size?

You can add up to 20 files at a time, each up to 20 MB.

Can I paste text instead of adding a file?

Yes. Paste or type text in the box next to the file button and press Convert to PDF.

Why do some letters look wrong?

The file probably uses a different encoding. In More options, set Text encoding to UTF-8, Windows (ANSI) or UTF-16 by hand.

Can I add page numbers?

Yes. Page numbers in the style Page 1 of 9 are on by default at the bottom of each page. Untick them if you do not want them.

Which fonts can I use?

Monospace (Liberation Mono), Sans (Liberation Sans, like Arial) and Serif (Liberation Serif, like Times), in sizes from 8 to 16 pt.

Is the text in the PDF searchable?

Yes. The PDF holds real text, so you can select it, copy it and search it with Ctrl+F.

Are my files safe?

Your files are laid out on our server and deleted right after. There is no account, so nothing is linked to you.

Can I change the line spacing or orientation?

Yes. In More options, choose line spacing 1.0, 1.15, 1.5 or 2.0, and Portrait or Landscape.

Can I convert a Word file here?

No. This page is for plain text. Use the Word to PDF tool for .doc and .docx files.

Turn your text into a PDF now

Free and quick. Spaces, line breaks and every character kept as they are.

Add your text file

Last updated October 2026 · Written and maintained by the FlipMyFormat team