How to use
- hosts
Paste or drop a hosts file
- Findings by line
Table of IPs and names, and findings
- hosts (LF or CRLF)sorted, deduplicated
Tidy and export
Paste the contents of a hosts file, or drop the file. “Try a sample” loads an example with duplicates and format errors.
Check the table of IPs and names. In “Findings”, see format errors, repeated host names, changed localhost lines, and trailing spaces or mixed tabs, each with its line number.
In “Tidy”, sort the lines, remove duplicates, comment out lines with errors, or turn loopback entries into 0.0.0.0 blocks. Choose LF or CRLF line endings.
Use “Save” to export the hosts file. Placing it in the system location (below) needs administrator rights.
What it does
IPv4 and IPv6 format checks
IPv4 must be four numbers from 0 to 255 (a leading zero is invalid). IPv6 checks the :: abbreviation and an IPv4 tail.
Duplicates by line number
When the same host name is given a different IP, the earlier line is shown. Some systems treat this differently, so the page says so.
Checks localhost
Checks the localhost lines for 127.0.0.1 and ::1. Flags a localhost pointing to another IP, or a missing 127.0.0.1 line.
Tidy options
Sort (IPv4 numerically), remove duplicates, comment out lines with errors, and block by changing 127.0.0.1 and ::1 to 0.0.0.0 (localhost lines are kept).
Save as LF or CRLF
The tidied text is saved as a file named hosts, with LF or CRLF line endings. No byte order mark is added.
Use cases
- Check the syntax of a hosts file before pointing a name at another IP for development
- Build a list that points advertising or tracking host names to 0.0.0.0
- Find out which of two entries for the same host name is used
- Check where the hosts file is and how to make a change take effect on Windows and macOS
Capability matrix
| Feature | Support | Notes |
|---|---|---|
| Table of IPs and names, with line-numbered findings (format, duplicates, localhost, whitespace) | Supported | — |
| Sort, dedupe, comment out, block with 0.0.0.0, and save as LF or CRLF | Supported | — |
| Writing directly to the system hosts file | Not supported | A browser cannot write it. Place the saved file yourself with administrator rights |
| Name resolution (checking which IP a name reaches) | Not supported | No network requests and no DNS lookups |
| How duplicates are handled by each OS | Partial | Shows the common behaviour (first line wins). It can differ by OS and version |
| Wildcard (*) host names | Not supported | hosts files do not support them, so they are flagged |
Limits & notes
- Input is limited to 200,000 characters and 5,000 lines. Anything beyond is not read, and you are told. The file size limit is 200 KB.
- The findings cover syntax and duplicates. They do not check whether a host name exists or which IP it reaches.
- Placing the saved file in the system location is up to you. Afterwards, clear the cache or restart the browser before you check.
Privacy & safety
Pasted text and files are processed only inside your browser. Nothing is sent to or stored on a server, and nothing is saved in the browser. Usage analytics never include content or file names.
FAQ
Where is the hosts file?
What happens if the same host name appears twice?
My change to the hosts file does not take effect. Why?
Is blocking ad or tracking hosts with 0.0.0.0 safe?
Why does the tool keep the localhost lines?
Related tools
IP / CIDR / Subnet Calculator
Enter an IP address or CIDR to get the network, broadcast, usable host range and subnet mask instantly. Split networks (VLSM), convert ranges to CIDR and check IP lists — for both IPv4 and IPv6.
SSH Config Studio
Paste your ~/.ssh/config to see the settings for each Host and the values that actually apply when you connect to a host name you choose. The first value found wins, so a Host * placed first hides later settings, and this tool flags that. It does not read Include files. To check how names resolve, use Hosts Studio.
Text Studio — Character Counter & Text Cleaner
Paste text to see characters, words, lines and bytes instantly, then clean it up in one click — change case, remove duplicate or blank lines, sort naturally, convert line breaks. Every action reports what changed and can be undone.
.env Studio
Paste or drop a .env file to see its keys and values in a table, with duplicates, empty values and syntax problems flagged by line. Values are hidden by default. You can compare a .env with a .env.example, or export an example file, JSON or a Kubernetes Secret. It checks common dotenv syntax, not tool-specific rules such as docker compose variable expansion.
Apache Config Studio
Paste .htaccess, httpd.conf or a VirtualHost to see its section tree and line-numbered findings: unclosed sections, unknown directives and overly open settings. You can also generate HTTPS redirect, www and HSTS snippets.
Caddyfile Studio
Paste a Caddyfile to see its site blocks, snippets ((name) and import) and matchers (@name) as a tree, with line-numbered findings for unbalanced braces and undefined references. You can also make reverse proxy, static site, SPA and www redirect templates.
Last updated: