2 MB TXT sample file

A TXT file of exactly 2,097,152 bytes. It is a valid Plain text file, generated for this site and checked with an independent parser. Use it wherever you need a 2 MB sample, test or dummy TXT file.

Download

sample-txt-2mb.txt

2 MB2,097,152 bytes

Download 2 MB TXT

Created in your browser in a few seconds, then checked against the SHA-256 checksum. No sign-up.

Type
text/plain
SHA-256
2325f614a91de9b6b3fbe03f67686591be36f4bb4211dc58064588f6e0e23d2b
Delivery
Created in your browser. Files of 2 MB and more have no direct URL (why).

What is in this file

20,633 numbered lines of plain English text, each prefixed with its line number and starting byte offset so truncation is easy to spot. A closing rule of "=" characters brings the file to the exact size.

Numbered lines20,633
EncodingUTF-8 (ASCII characters only)
Line endingsLF (Unix)

How the file begins

The opening lines of sample-txt-2mb.txt, exactly as they appear in the file.

SampleTestFiles sample text file (2 MB)
Encoding: ASCII, which is also valid UTF-8. Line endings: LF.
Each numbered line starts with its line number and the byte offset at which it begins.

0000001 000000190 This sample file exists so that software can be tested with realistic input.
0000002 000000285 Every line in this document was generated by a script and describes nothing confidential.
0000003 000000393 Use it to check that uploads, downloads and parsers behave the way you expect.
0000004 000000490 The file was built to an exact byte count, which makes size limits easy to verify.
0000005 000000591 If the last line of this file is missing, the transfer was cut short.
0000006 000000679 A good test fixture is boring, predictable and identical every time it is downloaded.
0000007 000000783 Compare the checksum published on the download page with the one you compute locally.

Preview

Creates the file in your browser and shows its first 64 KB.

Where 2 MB matters

A 2,097,152-byte file: exactly the default upload limit of PHP, and twice the default of nginx and Spring Boot. These are the default limits a file of this size is useful for testing:

SystemLimitNote
PHP2 MB per uploaded file by default (upload_max_filesize)A file of exactly 2 MB is accepted; one byte more is refused.
nginx1 MB by default (client_max_body_size)Rejected with 413 Request Entity Too Large.
Spring Boot multipart1 MB per file by default (max-file-size)Rejected unless the property is raised.
Django2.5 MB in memory by default2 MB is held in memory; the 5 MB sample is streamed to a temporary file.
Vercel Functions4.5 MB request bodyAccepted, including as base64 at about 2.8 MB.

All 2 MB sample files

Use this file for

  • Finding out whether a 1 MB default has been raised
  • Checking encoding handling
  • Testing line-ending normalisation

Testing notes for TXT

  • Plain text compresses very well, so a 10 MB text file may travel as a fraction of that when gzip or Brotli is enabled. Use the BIN samples when you need incompressible bytes.
  • Line endings change the byte count: converting LF to CRLF adds one byte per line, which breaks checksum comparisons.

TXT format reference

Technical details

File namesample-txt-2mb.txt
FormatTXT (Plain text)
Extension.txt
MIME typetext/plain
Size2,097,152 bytes (2 MB)
KindText
SHA-2562325f614a91de9b6b3fbe03f67686591be36f4bb4211dc58064588f6e0e23d2b
Created2026-10-14
ValidationExact size, signature bytes and structure checked when the generator was built; your copy is checked against the SHA-256 after it is created
PreviewAvailable on this page
SourceGenerated in your browser by this site's generator; not copied from elsewhere
LicenceFree to use, modify and redistribute (terms)
CategoryDocuments

Validated for expected format and integrity. As with any download, scan the file with your own security tools before opening it. How files are made and checked

Verify your copy

This file is created in your browser, so it has no direct URL for curl or wget. The bytes are the same every time and in every browser, so after saving it you can compare its checksum with the SHA-256 value above.

sha256sum sample-txt-2mb.txt     # Linux
shasum -a 256 sample-txt-2mb.txt # macOS

On Windows, run Get-FileHash sample-txt-2mb.txt -Algorithm SHA256 in PowerShell. For scripts and pipelines, save the file once and keep your own copy, or use a 1 MB file, which has a direct URL.

Related files

Questions about this file

Is this file exactly 2 MB?
Yes. It is 2,097,152 bytes, which is 2 MB in the binary units that operating systems and server limits use (1 KB = 1,024 bytes).
What is inside the 2 MB TXT file?
21,096 numbered lines of plain English text, each prefixed with its line number and starting byte offset so truncation is easy to spot. A closing rule of "=" characters brings the file to the exact size.
Which encoding do the text samples use?
The sized samples use only ASCII characters, which makes them valid UTF-8, ASCII and Latin-1 at once. A separate multilingual sample covers non-ASCII text.