Blog
SavedSearch
Visit Hostlelo

Is Your Page Over Googlebot's 2 MB Limit? Check With curl

Googlebot reads only the first 2 MB of a page, counted uncompressed. Measure yours with one curl command and move key tags above the cutoff in minutes.

The short answer

Googlebot fetches only the first 2 MB of an HTML page, including the HTTP response headers, and ignores everything after that cutoff. The limit applies to uncompressed data, so gzip or Brotli does not help. Run curl -s --compressed on your URL and pipe it to wc -c to get the number Google counts, then keep it well under 2,000,000 bytes with your title, canonical and structured data near the top.

Reading options

On this page

Googlebot reads only the first 2 MB of an HTML page, and that count includes the HTTP response headers. Anything after that point is never fetched, rendered or indexed. You can check your own page in about a minute with one curl command that measures the uncompressed size, which is the number Google actually counts.

Here is the part that surprises most people: turning on gzip or Brotli does not help with this limit at all. Google's own documentation says the size limit is applied to the uncompressed data, so a page that travels over the wire as 300 KB can still be 2.5 MB once it is unpacked. Your speed test looks great, and Googlebot still stops reading halfway down the page.

By the end of this guide you will be able to measure your page the way Google sees it, find what is making it heavy, and move the important tags to where Googlebot will always read them.

What does the 2 MB limit actually mean?

On 31 March 2026, Google published a Search Central blog post called Inside Googlebot: demystifying crawling, fetching, and the bytes we process. It says Googlebot "currently fetches up to 2MB for any individual URL (excluding PDFs)", and that this includes the HTTP header. For PDF files the limit is 64 MB.

Heads up: an update on that post, dated 29 October 2026, corrected the wording to say the limit includes the HTTP response headers, which are the lines your server sends back before the page itself.

The post also explains what happens when a page is too big. Googlebot does not reject it. It stops the fetch at the 2 MB cutoff and passes those bytes to indexing and to the Web Rendering Service (the part of Google that runs your JavaScript, like a browser would) as if that were the complete file. Bytes after the cutoff are ignored.

Think of a reader who promised to read exactly 20 pages of your report and then put it down. If your conclusion is on page 25, that reader will never know it exists.

A few more details worth knowing:

  • Each CSS file and JavaScript file your page references is fetched separately and gets its own byte counter. It does not count toward the size of the HTML page.
  • The Googlebot documentation says: "Googlebot crawls the first 2MB of a supported file type, and the first 64MB of a PDF file."
  • The same page says "The file size limit is applied on the uncompressed data."
  • Other Google crawlers that do not set their own limit use a default of 15 MB, according to both the blog post and the overview of Google crawlers and fetchers.

Why this matters: Google's post says that for most of the web, 2 MB of HTML is "massive" and you will never hit it. The pages that do hit it usually have inline base64 images, big blocks of inline CSS or JavaScript, or megabytes of menus before the real content starts. If your title, canonical tag or structured data sits after the cutoff, Google cannot use it.

One more honest note. Google writes "2MB" without saying whether that means 2,000,000 bytes or 2,097,152 bytes (2 times 1024 times 1024). To stay safe, treat 2,000,000 bytes as your ceiling, and remember the headers take a small slice of it.

At the time of writing (3 December 2026), these are the numbers Google publishes. The blog post itself says the limit "is not set in stone and may change over time", so check the source pages again if you are reading this much later.

Before you start

You do not need server access for the main check, only the public page.

  • Access: the public URL of the page you want to test. For the Search Console check, you also need access to the Search Console property for that site.
  • Tools: a terminal with curl installed. Most macOS and Linux systems already have it. Run curl --version to check.
  • Backup: measuring is read only and changes nothing. Before you edit any template, theme or page file in the fix steps, download a copy of that file or take a full site backup from your hosting panel.
  • Time: about 5 minutes to measure, and 30 to 60 minutes for most fixes.
  • Risk level: none for measuring. Low to medium for fixes, because a mistake in a template can break the layout. Test on a staging copy if you have one.

Measure your page the way Googlebot counts it

Step 1: Get the uncompressed body size

This is the main check. The command below asks the server for a compressed response, lets curl unpack it, and counts the bytes of the unpacked page.

curl -s --compressed https://example.com/ | wc -c

Replace https://example.com/ with your real page. Here is what each part does:

  • -s is silent mode. It hides the progress meter so only the page content goes through the pipe.
  • --compressed asks for a compressed response and, as the curl man page puts it, will "automatically decompress the content".
  • wc -c counts the bytes it receives.

You will see a single number, for example 48213. That is the size of your HTML in bytes after decompression, which is the version that counts toward Google's limit.

Quick tip: to see the difference compression makes, the command below prints the number of bytes that actually travelled over the network.

curl -s --compressed -o /dev/null -w '%{size_download}\n' https://example.com/

The curl man page describes size_download as "the size of the body/data that was transferred, excluding headers". When the server compresses the page, this number is the compressed size, so it will usually be much smaller than the wc -c result. When I tested a Google documentation page today, wc -c reported about 180,000 bytes while size_download reported about 30,000. Same page, two very different numbers. Only the bigger one matters for the 2 MB limit.

Step 2: Look at the response headers

The headers count too, so take a quick look at them. This command sends a HEAD request, which fetches the headers only.

curl -sI https://example.com/

You should see a status line such as HTTP/2 200, followed by lines like content-type, cache-control and maybe content-encoding. If you see 301 or 302 with a location header, the URL redirects, and you should measure the final URL instead (see the troubleshooting section).

To get the header size as a number, ask curl for size_header, which the man page defines as the total bytes of the downloaded headers.

curl -s --compressed -o /dev/null -w '%{size_header}\n' https://example.com/

On most sites this is a few hundred bytes to a few kilobytes. If it is much bigger, look at long cookies or a long list of security headers.

Step 3: Save both parts and add them up

If you plan to fix things, it helps to have the page saved locally. The command below saves the headers to headers.txt and the decompressed page to page.html in your current folder.

curl -s --compressed -D headers.txt -o page.html https://example.com/

Now count both files together. wc -c prints the size of each file and a total line at the end.

wc -c page.html headers.txt

The total line is your best estimate of what Googlebot counts for that URL.

Step 4: Read your result

Here is how to read the number:

  • Under 500,000 bytes: you are nowhere near the limit. You can stop here for this page.
  • 500,000 to 1,500,000 bytes: you are safe today, but the page is heavy. Check that your important tags are near the top, which is cheap insurance.
  • 1,500,000 to 2,000,000 bytes: you are close. A few more products, comments or inline images could push you over. Fix it now.
  • Over 2,000,000 bytes: part of your page is being cut off for Googlebot. Find out what sits after the cutoff and fix it.

These bands are my own working guide, not Google rules. Google only publishes the 2 MB cutoff.

Find what is making the page heavy

Made-up example: imagine a small online shop. The category page shows 60 products, and a page builder plugin has pasted each product thumbnail into the HTML as a base64 string (an image turned into a long block of text). Each thumbnail adds around 35 KB of text. That is roughly 2.1 MB of image data inside the HTML, before a single word of product description. All of these numbers are invented for illustration, but the pattern is a real one Google names in its post.

Step 5: Check for inline base64 images

The command below counts how many base64 blocks are in the saved page.

grep -o 'base64,' page.html | wc -l

If you get 0, base64 images are not your problem. If you get a number above zero, the next command lists the 10 biggest data blocks, with their size in characters, so you can see how much they cost.

grep -o 'data:[a-z/+.-]*;base64,[A-Za-z0-9+/=]*' page.html | awk '{ print length($0) }' | sort -rn | head -10

Each number is roughly how many bytes that block adds to your HTML. Small icons are fine. Blocks of 50,000 or more are worth replacing.

The fix: save each large image as a normal file (for example product-01.webp) and reference it with a regular img tag that points to the file. Images loaded from separate files do not count toward the HTML page's byte limit. If a plugin or page builder is creating the base64 code, look in its settings for an option that inlines images, and turn it off.

Step 6: Check for big inline style and script blocks

Inline CSS sits inside <style> tags in the HTML, and inline JavaScript sits inside <script> tags with no src attribute. Both count toward the HTML size. The command below counts the inline script tags.

grep -o '<script[^>]*>' page.html | grep -vc 'src='

The next command counts the <style> blocks.

grep -o '<style[^>]*>' page.html | wc -l

This count includes JSON-LD structured data blocks, which are fine to keep. A handful of small inline blocks is normal. Dozens of them, or a page where most of the file is code when you open page.html in a text editor, means you have room to slim down.

The fix: this is exactly what Google recommends in its post: "Move heavy CSS and JavaScript to external files." Copy the code into a file such as site.css or site.js, upload it, and load it with a link tag or a script tag with a src attribute. Google fetches those files separately, each with its own limit.

Heads up: be careful with inline scripts that hold data the page needs right away, such as settings for a theme. Moving them can break things. Test the page in a browser after every change, and keep your backup ready.

Step 7: Check the order of your head tags

Even if your page is well under 2 MB today, it is smart to make sure the important tags come early. Google's post asks you to place "meta tags, <title> elements, <link> elements, canonicals, and essential structured data" higher in the HTML.

The command below prints the byte position where each important tag starts in your saved page. The -b option makes grep print the byte offset before each match.

grep -b -o -E '<title|rel="canonical"|<meta name="description"|application/ld\+json' page.html

You will see lines like 1287:<title or 2650:rel="canonical". The number before the colon is how many bytes into the file that tag starts. Good result: every number is small, ideally within the first few kilobytes. Warning sign: any number close to or above 2,000,000.

Quick tip: if your structured data shows up far down the page, it is often because a theme or plugin prints it in the footer. Many SEO plugins have a setting for this, or you can move the JSON-LD block (structured data written as a <script type="application/ld+json"> block) into the head of your template.

Variants that change your result

If the URL redirects

If curl -sI shows a 301 or 302, add -L. The man page says this option makes curl "redo the request to the new place" when the server reports a move.

curl -s -L --compressed https://example.com/ | wc -c

If your site sits behind a CDN or bot protection

Some CDNs and security tools send a challenge page to tools like curl. That page is small, so your number will look great and be completely wrong. Open page.html in a text editor and check that it is really your page. If you are moving between CDNs, our guide on keeping Googlebot crawling during a CDN move covers that side of things.

How to check it worked

Run these checks after every fix.

Check 1: Measure again with curl

Run the Step 1 command again on the same URL.

curl -s --compressed https://example.com/ | wc -c

Expected result: a smaller number than before, comfortably under 2,000,000.

Check 2: Confirm the tags moved up

Download a fresh copy and run the Step 7 grep command again. Expected result: the byte offsets for the title, canonical and structured data are now small numbers near the top of the file.

Check 3: See what Google received in Search Console

This is the check that shows you Google's own view. According to the URL Inspection tool help page, it works like this:

  1. Open Search Console and type the full URL into the inspection search bar at the top of any screen. The URL must belong to the property you have open.
  2. Click Test live URL. The page must be reachable from the internet without a login.
  3. When the test finishes, click View tested page on the page verdict card.
  4. Look at the raw HTML returned. Scroll to the end and check that your footer and your last pieces of content are there.
  5. Click View tested page > More info to see the list of page resources, JavaScript console output and the HTTP headers.

Expected result: the HTML ends where your real page ends, and your title, canonical and structured data are all present. Google notes that this extra response data is only available when the live test status is URL is available to Google or URL is available to Google, but has issues.

Why this matters: curl shows what your server sends, and Search Console shows what Google got. When they agree, you can trust your fix.

Troubleshooting

The number is tiny, like a few hundred bytes

Symptom: wc -c prints something like 162 for a page you know is long. Likely cause: the URL redirects, and you measured the short redirect response. Fix: run curl -sI on the URL, look for a 301 or 302 with a location header, then measure with -L or use the final URL directly.

The write-out number is much smaller than wc -c

Symptom: %{size_download} shows 40,000 but wc -c shows 250,000. Likely cause: nothing is wrong. size_download measures the bytes transferred, which are compressed. Fix: use the wc -c number for the 2 MB check. Compression speeds up delivery but does not change what Google counts. If you want to confirm compression is working at all, see our guide on checking gzip and Brotli with curl.

curl exits with code 6 or 60

Symptom: with -s, curl prints nothing and the shell shows an error exit. Add -S (show errors) to see a message. Likely cause: the man page lists exit code 6 as "Could not resolve host" and exit code 60 as "Peer certificate cannot be authenticated with known CA certificates." Fix: for code 6, check the spelling of the domain and your DNS records. For code 60, fix the SSL certificate on the server. Do not switch off certificate checks just to make the test pass.

The saved page is not your page

Symptom: page.html contains a "checking your browser" screen, a cookie wall or a login form. Likely cause: bot protection, a firewall rule or a login requirement is blocking curl. Fix: test the same URL in Search Console with Test live URL. If Google also gets the challenge page, that is a much bigger problem than page size, and you should talk to whoever manages your CDN or firewall.

View tested page is greyed out

Symptom: you clicked Test live URL, but View tested page is not available. Likely cause: the Search Console help page says this typically means the page could not be reached for the live test. Fix: check that the page loads publicly without a login, then rerun the live test.

The page is small but content is still missing in Search Console

Symptom: curl shows 300,000 bytes, yet some text is missing from what Google sees. Likely cause: this is probably not the size limit. The content may be added later by JavaScript, or blocked by something else. Fix: check the JavaScript console output under More info, and look at whether that content is in page.html at all. If it is not in the raw HTML, the browser builds it after load.

Pro tips and when to ask for help

  • Measure your heaviest pages first, such as big category pages and pages built with visual builders.
  • Re-check after big theme, plugin or page builder updates. These are the moments inline code tends to grow.
  • A lean HTML page is also faster for real visitors. Our guide on how to improve website speed covers the browser side.

Ask a developer if the heavy code comes from a custom theme, because moving inline scripts can break features. Ask your host if curl keeps hitting challenge pages or certificate errors you cannot fix yourself.

The one message worth forwarding

Copy this to your developer, agency or whoever looks after your site:

"Hi, Google says Googlebot only reads the first 2 MB of an HTML page, counted after decompression and including response headers (Google Search Central blog, 31 March 2026, and the Googlebot docs). Could you run curl -s --compressed https://example.com/ | wc -c on our biggest pages and tell me the numbers? If any are over about 1.5 MB, please move inline base64 images and large inline CSS or JS into separate files, and make sure the title, meta description, canonical and JSON-LD sit near the top of the head. Thanks."

The takeaway: compression makes your page travel faster, but Google counts the unpacked bytes, so measure with wc -c and keep the important tags at the top.

Reader questions

Does gzip or Brotli compression help me stay under Googlebot's 2 MB limit?

No. Google's Googlebot documentation says the file size limit is applied to the uncompressed data, so compression speeds up delivery but does not change the size Google counts.

Do my CSS and JavaScript files count toward the 2 MB HTML limit?

No. Google says each referenced CSS or JavaScript file is fetched separately with its own byte counter, so it does not add to the parent page's size. Each of those files has its own 2 MB limit.

What happens if my HTML page is bigger than 2 MB?

Google does not reject the page. Googlebot stops at the cutoff and treats the first 2 MB as the whole file, and anything after that is not fetched, rendered or indexed.

Is the limit different for PDF files?

Yes. Googlebot fetches up to 64 MB of a PDF file, according to Google's documentation at the time of writing (3 December 2026).

Do HTTP headers count toward the 2 MB limit?

Yes. Google's March 2026 Search Central post, as corrected on 29 October 2026, says the 2 MB limit includes the HTTP response headers. They are usually small, but measure them with curl rather than guessing.

Is 2 MB the same limit for every Google crawler?

No. Google says crawlers that do not set their own limit default to 15 MB, while Googlebot for Search uses 2 MB for HTML and other supported files.

Why does curl's `size_download` show a much smaller number than wc -c?

The curl man page says `size_download` is the size of the data that was transferred, which is the compressed size when the server compresses the page. Use the wc -c number on the decompressed body for the 2 MB check.

Sources & further reading

  1. Google Search Central Blog: Inside Googlebot: demystifying crawling, fetching, and the bytes we process (31 March 2026)
  2. Google Search Central: Googlebot documentation
  3. Google: Overview of Google crawlers and fetchers
  4. Search Console Help: URL Inspection tool
  5. curl man page

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close