
15
How to Check HTTP Headers: A Beginner’s Guide to Understanding Website Headers
How to Check HTTP Headers
If you have ever copied a URL and noticed strange characters such as %20, %3F, %2F, or %26, you have probably encountered URL encoding. At the same time, if you have ever wondered how browsers and search engines communicate with websites, HTTP headers are an important part of that process.
URL encoding and HTTP headers may sound technical, but understanding the basics can help website owners, bloggers, developers, SEO professionals, and beginners troubleshoot common website problems.
In this beginner-friendly guide, we will explain what URL encoding is, why it is important, what HTTP headers are, how to check HTTP headers, how to read common header values, and how URL encoding and HTTP requests work together.
What Is URL Encoding?
URL encoding, also called percent-encoding, is a method used to represent characters in a URL that may not be safe or valid to use directly.
URLs can contain letters, numbers, and certain special characters. However, some characters have special meanings in URLs or may cause problems when transmitted over the internet.
URL encoding converts these characters into a format that can be safely transmitted.
For example, a space can be represented as:
%20
So this URL:
https://example.com/my page
can become:
https://example.com/my%20page
The %20 tells the browser that the original character was a space.
Why Is URL Encoding Important?
URL encoding is important because URLs are used to transfer information between browsers, servers, applications, and other online systems.
Without proper encoding, certain characters could be interpreted incorrectly.
For example, consider a URL containing search parameters:
https://example.com/search?q=red shoes
The space between "red" and "shoes" should be encoded:
https://example.com/search?q=red%20shoes
This makes the URL safer and easier for systems to interpret correctly.
URL encoding is especially important when URLs contain:
- Spaces
- Special characters
- Query parameters
- Non-English characters
- Symbols
- User-generated text
- File names
- Search terms
Common URL Encoding Examples
Here are some commonly encoded characters:
CharacterURL Encoded
Space | %20
! | %21
" | %22
# | %23
$ | %24
% | %25
& | %26
' | %27
( | %28
) | %29
+ | %2B
/ | %2F
: | %3A
; | %3B
= | %3D
? | %3F
@ | %40
The encoded value generally begins with % followed by two hexadecimal characters.
For example, %2F represents /, while %3F represents ?.
URL Encoding vs. URL Decoding
There are two related processes: encoding and decoding.
URL encoding converts special characters into their encoded representation.
For example:
hello world
becomes:
hello%20world
URL decoding reverses the process:
hello%20world
becomes:
hello world
This is useful when an application receives encoded information from a URL and needs to convert it back into readable text.
What Are HTTP Headers?
Now that we understand URL encoding, let's look at the second important part of the topic: HTTP headers.
HTTP headers are pieces of information exchanged between a client and a web server when an HTTP request or response is made.
The browser is usually the client.
When you visit a website, your browser sends an HTTP request to the server. The server processes the request and sends an HTTP response back.
Headers provide additional information about these requests and responses.
They can tell the browser and server things such as:
- What type of content is being requested
- What type of browser is making the request
- Whether content can be cached
- What language is preferred
- Whether a page has been redirected
- What security policies should be applied
- What type of content the server returned
How HTTP Requests Work
A simplified website request looks like this:
Browser → HTTP Request → Web Server
The server then responds:
Web Server → HTTP Response → Browser
Both the request and response can contain HTTP headers.
For example, a request might contain information such as:
GET /about/ HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 Accept: text/html
The server may respond with:
HTTP/1.1 200 OK Content-Type: text/html Content-Length: 2456
The browser uses this information to understand how to process the response.
What Are Request Headers?
Request headers are sent from the client to the server.
They provide information about the request and the client making it.
Some common request headers include:
User-Agent
The User-Agent header identifies the browser, operating system, or other client making the request.
For example:
User-Agent: Mozilla/5.0
The actual value can be much longer and can contain information about the browser and operating system.
Accept
The Accept header tells the server what types of content the client can process.
For example:
Accept: text/html
A browser may send multiple accepted formats.
Accept-Language
This header can indicate the user's preferred language.
For example:
Accept-Language: en-US,en;q=0.9
Cookie
The Cookie header can send stored cookie information back to the server.
For example:
Cookie: session_id=example123
Cookies can contain session information, preferences, and other data.
What Are Response Headers?
Response headers are sent from the server back to the browser.
They tell the browser how to handle the server's response.
Some of the most important response headers include the following.
Content-Type
The Content-Type header tells the browser what type of content was returned.
For example:
Content-Type: text/html
A JSON response might use:
Content-Type: application/json
An image may have a content type such as:
Content-Type: image/jpeg
Content-Length
Content-Length indicates the size of the response body in bytes.
For example:
Content-Length: 5234
Cache-Control
Cache-Control provides instructions about caching.
For example:
Cache-Control: max-age=3600
This can tell browsers or intermediary caches how long a resource may be considered fresh.
Location
The Location header is commonly used with redirects.
For example:
Location: https://example.com/new-page/
A browser receiving a suitable redirect response can then request the new URL.
Server
The Server header may identify information about the software handling the request.
For example:
Server: nginx
However, website administrators can configure servers not to reveal certain information.
What Does HTTP Status Code Mean?
HTTP status codes are not technically headers, but they are closely related to HTTP responses and are extremely useful when checking headers.
A status code tells you what happened to the request.
200 OK
A 200 status generally means the request was successful.
301 Moved Permanently
A 301 redirect indicates that a resource has permanently moved to another URL.
302 Found
A 302 response is commonly used for temporary redirection.
304 Not Modified
A 304 response can indicate that a cached version of a resource can still be used.
400 Bad Request
A 400 response generally means the server could not properly understand the request.
401 Unauthorized
A 401 response indicates that authentication may be required.
403 Forbidden
A 403 response indicates that the server understood the request but is refusing access.
404 Not Found
A 404 response usually means the requested resource could not be found.
500 Internal Server Error
A 500 response indicates that the server encountered an unexpected problem.
How to Check HTTP Headers in Your Browser
You do not need to be an advanced developer to check HTTP headers.
Most modern browsers include built-in developer tools that allow you to inspect network requests.
The process is similar in browsers such as Chrome, Edge, and Firefox.
Step 1: Open the Website
Visit the webpage you want to inspect.
For example:
https://example.com
Step 2: Open Developer Tools
In Chrome or Edge, you can usually open Developer Tools by pressing:
F12
You can also right-click the webpage and select Inspect.
Step 3: Open the Network Tab
Inside Developer Tools, select the Network tab.
This section shows network activity generated by the webpage.
Step 4: Reload the Page
Refresh the webpage while the Network tab is open.
You should see multiple requests appear.
These may include:
- HTML documents
- CSS files
- JavaScript files
- Images
- Fonts
- API requests
- Other resources
Step 5: Select a Request
Click the main document request, usually the webpage's URL.
A panel containing additional information should appear.
Look for a section called Headers.
Step 6: Examine the Headers
You will typically see sections such as:
- General
- Request Headers
- Response Headers
You can inspect the information associated with the request and response.
How to Check HTTP Headers Using Command Line
If you are comfortable using the command line, tools such as curl can be useful.
For example:
curl -I https://example.com
The -I option requests the HTTP headers without downloading the entire page content.
A response might look similar to:
HTTP/2 200 content-type: text/html cache-control: max-age=3600 server: nginx
This is a quick way to inspect a website's response headers.
How to Check HTTP Headers Online
There are also online HTTP header checker tools.
These tools can be useful if you do not want to open browser developer tools or use the command line.
Typically, you enter a URL and the tool displays information such as:
- HTTP status code
- Response headers
- Redirects
- Content type
- Server information
- Cache-related headers
- Security headers
When using an online checker, avoid submitting URLs containing private information, authentication tokens, or sensitive query parameters.
Why Website Owners Should Check HTTP Headers
HTTP headers can provide valuable information when troubleshooting a website.
For example, if a webpage unexpectedly redirects, checking the headers can reveal whether the server is returning a 301 or 302 response.
If a page is returning the wrong content type, the Content-Type header can help identify the problem.
If a website is not caching resources correctly, examining Cache-Control and related headers can provide useful clues.
Headers can also help diagnose security configuration problems.
Important Security Headers
Several HTTP response headers are commonly associated with website security.
Strict-Transport-Security
The Strict-Transport-Security header, commonly called HSTS, tells compatible browsers that a website should be accessed using HTTPS for a specified period.
Example:
Strict-Transport-Security: max-age=31536000
Content-Security-Policy
The Content-Security-Policy header helps website owners control which resources browsers are allowed to load.
Example:
Content-Security-Policy: default-src 'self'
CSP can be powerful, but incorrect configurations can accidentally prevent legitimate website resources from loading.
X-Content-Type-Options
A commonly used value is:
X-Content-Type-Options: nosniff
This helps prevent browsers from MIME-sniffing certain responses in situations where that behavior could create security problems.
Referrer-Policy
The Referrer-Policy header controls what referrer information browsers send when navigating from one page to another.
For example:
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy
Permissions-Policy can control access to certain browser features and capabilities.
The exact policy depends on the features a website needs.
HTTP Headers and SEO
HTTP headers can also matter for technical SEO.
Search engines need to understand how pages respond, whether URLs redirect, and what content is being served.
For example, if you move a page permanently, a properly configured 301 redirect can help communicate that the old URL has moved.
HTTP status codes can also help identify broken pages.
For example:
- 200 — page successfully available
- 301 — permanent redirect
- 302 — temporary redirect
- 404 — page not found
- 500 — server error
Checking these responses can help identify technical problems that may affect the user experience and search engine crawling.
URL Encoding and Query Parameters
URL encoding becomes especially important when working with query parameters.
Consider:
https://example.com/search?q=fall wedding ideas
The space should generally be encoded when constructing a URL:
https://example.com/search?q=fall%20wedding%20ideas
Another example is an ampersand.
The & character is commonly used to separate query parameters:
https://example.com/search?q=shoes&color=black
If an ampersand is part of the actual value rather than a parameter separator, it may need appropriate encoding depending on the context.
This distinction is important because URL syntax gives certain characters special meanings.
Does URL Encoding Change the Actual URL?
URL encoding changes how certain characters are represented, but it does not necessarily mean that the underlying resource is different.
For example:
hello world
and:
hello%20world
represent the same text after decoding.
However, whether two URLs are treated as equivalent can depend on the particular URL component, server, application, and normalization rules.
Website developers should therefore avoid assuming that every differently formatted URL is automatically treated as identical.
URL Encoding vs. HTML Encoding
Beginners sometimes confuse URL encoding with HTML encoding.
They are different processes.
URL encoding is used when representing data inside URLs.
HTML encoding is used when representing certain characters safely inside HTML.
For example, HTML commonly represents an ampersand as:
&
URL encoding represents an ampersand as:
%26
The correct method depends on where the data is being placed.
URL Encoding vs. Base64
URL encoding is also different from Base64 encoding.
URL encoding replaces certain characters with percent-encoded representations.
Base64 converts binary or textual data into a larger text representation using a specific character set.
For normal URL query parameters, URL encoding is generally the relevant concept rather than Base64.
Common HTTP Header Problems
When troubleshooting a website, you may encounter several header-related problems.
Incorrect Content-Type
If the server sends the wrong Content-Type, browsers may not process the resource as expected.
Unexpected Redirects
A chain of redirects can slow down navigation and make troubleshooting more difficult.
For example:
URL A → URL B → URL C → URL D
It is generally better to avoid unnecessary redirect chains.
Incorrect Cache Settings
Poor caching configuration can result in users receiving stale content or resources being downloaded more often than necessary.
Missing Security Headers
A website may benefit from security headers depending on its architecture and requirements.
However, security headers should be configured carefully rather than added blindly.
Server Errors
Repeated 500-level responses can indicate server-side problems that need investigation.
How to Read an HTTP Header Response
When you check a webpage's headers, do not feel overwhelmed by the amount of information.
Start with a few important values.
First, look at the status code.
If you see:
200 OK
the request was generally successful.
Next, check the Content-Type.
For a normal HTML page, you might see:
Content-Type: text/html
Then check whether there are redirects.
If the original request returns something like:
301 Moved Permanently Location: https://example.com/new-url/
the server is telling the client to use another URL.
Finally, look at caching and security-related headers if those are relevant to your troubleshooting.
Common Mistakes Beginners Make
One common mistake is assuming that URL encoding means encrypting a URL.
URL encoding is not encryption.
Anyone who can see the URL can generally decode percent-encoded values.
Another mistake is manually encoding every character.
Only characters that need encoding should be encoded according to the relevant URL syntax and context.
Another common mistake is confusing %20 with +.
In some query-string form encoding contexts, a space may be represented by +. However, + also has its own meaning in some URL contexts, so you should not treat %20 and + as universally interchangeable.
A Simple Website Header-Checking Workflow
If you are troubleshooting a webpage, use this simple process:
- Open the webpage.
- Open your browser's Developer Tools.
- Select the Network tab.
- Reload the webpage.
- Select the main document request.
- Review the status code.
- Check the response headers.
- Look for redirects.
- Check the Content-Type.
- Review cache and security headers when necessary.
This workflow can help you identify many common website configuration problems.
Frequently Asked Questions
What is URL encoding in simple terms?
URL encoding is a way of representing certain characters in a URL using percent signs followed by hexadecimal values. For example, a space can be represented as %20.
What does %20 mean in a URL?
%20 is the percent-encoded representation of a space character.
What are HTTP headers?
HTTP headers are pieces of information exchanged between a client and server during HTTP requests and responses. They provide instructions and metadata about the communication.
How can I check HTTP headers?
You can check HTTP headers using browser Developer Tools, command-line tools such as curl, or online HTTP header checker tools.
Are HTTP headers important for SEO?
They can be. Status codes, redirects, caching behavior, and other HTTP response information can affect how websites function and how search engines interact with URLs.
Is URL encoding the same as encryption?
No. URL encoding is not a security mechanism or encryption method. Encoded information can generally be decoded.
What does a 301 response mean?
A 301 status code indicates that a resource has been permanently redirected to another URL.
What does a 404 response mean?
A 404 status code generally means that the requested resource could not be found.
Final Thoughts
URL encoding and HTTP headers are two important parts of how websites communicate across the internet.
URL encoding helps represent special characters and other data safely within URLs, while HTTP headers provide important information and instructions during communication between browsers and web servers.
You do not need to become a professional developer to understand the basics. By learning how to recognize encoded characters such as %20, %2F, and %3F, and by knowing how to inspect HTTP headers using your browser's Network tools, you can become much better at troubleshooting URLs, redirects, caching, content types, and other technical website issues.
For website owners and SEO beginners, regularly checking HTTP responses can be a simple but useful part of technical website maintenance. When something appears wrong with a URL or webpage, the HTTP status code and headers can often provide the first clues about what is happening behind the scenes.
Contact
Missing something?
Feel free to request missing tools or give some feedback using our contact form.
Contact Us