Make an IP badge
Pick a style and a color, copy one line of code, and drop a small badge that shows an IP into a web page, a README or a forum signature.
Customize your badge
Pick a language and the right segment shows the code plus the country name, like US United States. Leave it off for the code only.
Preview and embed code
https://www.anbovpn.com/api/tools/badge/check-ip<img src="https://www.anbovpn.com/api/tools/badge/check-ip" alt="IP badge">[img]https://www.anbovpn.com/api/tools/badge/check-ip[/img]Note: badges showing the visitor's IP show the exit IP of whoever is viewing the page. Once you embed one in a public page, every visitor sees their own address, not yours, and sites such as GitHub fetch images through their own image servers, so the address shown may be that proxy's. To always show one fixed IP, choose "A specific IP + country".
IP geolocation data may come from IP2Location.io and ipapi.is. Locations are approximate.
Common styles and embed code
These are the most common forms, and each one can be copied as HTML, Markdown or BBCode. The last segments of the address set the style: check-ip is the visitor's IP plus country code, add -en for the country name, then -blue, -green or a 6-digit hex to change the color. The specified IP in the examples is 8.8.8.8.
Visitor IP only (one segment)
<img src="https://www.anbovpn.com/api/tools/badge/myip" alt="IP badge">One segment + color name (gray)
<img src="https://www.anbovpn.com/api/tools/badge/myip-gray" alt="IP badge">One segment + hex color
<img src="https://www.anbovpn.com/api/tools/badge/myip-111827" alt="IP badge">Visitor IP + country code (two segments)
<img src="https://www.anbovpn.com/api/tools/badge/check-ip" alt="IP badge">Two segments + color name (green)
<img src="https://www.anbovpn.com/api/tools/badge/check-ip-green" alt="IP badge">Two segments + hex color
<img src="https://www.anbovpn.com/api/tools/badge/check-ip-16a34a" alt="IP badge">Specified IP + country code
<img src="https://www.anbovpn.com/api/tools/badge/check-8.8.8.8" alt="IP badge">Specified IP + red
<img src="https://www.anbovpn.com/api/tools/badge/check-8.8.8.8-red" alt="IP badge">Visitor IP + code + country name
<img src="https://www.anbovpn.com/api/tools/badge/check-ip-en" alt="IP badge">Country name + blue
<img src="https://www.anbovpn.com/api/tools/badge/check-ip-en-blue" alt="IP badge">Specified IP + country name
<img src="https://www.anbovpn.com/api/tools/badge/check-8.8.8.8-en" alt="IP badge">Specified IP + country name + green
<img src="https://www.anbovpn.com/api/tools/badge/check-8.8.8.8-en-green" alt="IP badge">What the badge shows
A badge is a tiny SVG image that our server generates on the fly once it is embedded in a page. You don't need to write any script.
IP, country code and country name
The left side is the IP address; the right side (two-segment styles) is the two-letter country code, such as US or JP. Add a language segment to the address (-zh, -zht, -en, -ja, -ru, -fa, -tr) and the right side becomes the code plus the country name, such as US United States. The country comes from an IP location database and is an estimate; when it can't be found or the allowance is used up, it shows --.
Three styles, twelve colors
Visitor IP only (one segment), visitor IP + country, or a specific IP + country. Choose from 12 color names (blue, green, gray, red, yellow, orange, purple, black, sky, cyan, emerald, rose) or any 6-digit hex color; text on light or dark backgrounds switches between black and white by itself.
Caching and limits
Existing database results do not consume new country-lookup allowance; a data provider is called only on a database miss. When the allowance is used up, the country for IPs not yet stored shows --.
Privacy
We do not store badge-viewer identities, view counts, or per-request viewing history, and nothing is linked to an account. A specific IP is exposed in the image URL, so do not make a badge for an address you need to keep private. Country results are stored once per IP; the IP is sent to IP2Location.io and ipapi.is only on a database miss.
How to make and embed an IP badge
- Under "Style", choose visitor IP only, visitor IP + country, or a specific IP + country (the last one asks for an IPv4 or IPv6 address).
- With a style that has a country, you can pick a language under "Country name language" so the right side shows the code plus the country name. Leave it off for the two-letter code only.
- Click a preset color, or type a 6-digit hex under "Custom color" (no #, for example 1a8cff). The preview below updates right away.
- Under "Preview and embed code", copy the format you need: image address, HTML, Markdown (GitHub README, docs) or BBCode (forum signatures).
- Paste the code into your web page, README or forum signature. A visitor-IP badge shows each viewer their own address; to show everyone the same IP, use a specific-IP style.
Badge address and options explained
The badge address is /api/tools/badge/[spec], and every option goes into that last segment, joined with hyphens.
- myip
- A single-segment badge that shows only the viewer's own IP. It's the cleanest output, good for READMEs and status pages that show the current exit IP. Examples: myip, myip-gray.
- check-ip
- A two-segment badge: the viewer's own IP on the left, the two-letter country code (such as US or JP) on the right. Examples: check-ip, check-ip-green.
- check-<IP>
- A two-segment badge for the country of a specific IPv4 or IPv6, useful for turning a suspicious IP into a label in tickets, alerts and log analysis. Examples: check-8.8.8.8, check-2606:4700:4700::1111.
- Language segment: -zh, -zht, -en, -ja, -ru, -fa, -tr
- Goes after the IP and before the color; the right side becomes the code plus the country name, such as US United States. zh is Simplified Chinese and zht is Traditional Chinese. Examples: check-ip-en, check-8.8.8.8-ja-red. myip has no country, so it takes no language segment.
- Color names
- blue (default), green, gray, red, yellow, orange, purple, black, sky, cyan, emerald, rose. In a two-segment badge the color applies to the right segment (the country); a one-segment badge changes entirely.
- Hex colors
- Six hex digits without #, such as 16a34a. Use it to match a brand or theme color; on light colors the text switches to dark so it stays readable. Example: check-ip-en-16a34a.
- One vs two segments, small screens
- A one-segment badge is the narrowest and suits phones and narrow columns; a two-segment badge with a country is wider, and with a country name wider still. Badges are vector images, so scaling them with the HTML height doesn't blur them.
- HTML / Markdown / BBCode
- HTML: <img src="…" alt="…">. Markdown: , for GitHub and GitLab docs. BBCode: [img]address[/img], for most forum signatures. All three use the same image address.
- Caching
- Visitor-IP badges return private, no-store and are not cached. Badges for a specific IP return public, max-age=3600 (1 hour), or max-age=60 when the country couldn't be found.
- Country shows --
- Shown when the IP is a private or reserved address, the database has no country for it, or the day's country lookup allowance is used up. The allowance resets every day.
- When the address is invalid
- A wrong form (misspelled language, a color that is neither one of the 12 names nor 6 hex digits, an invalid IP) returns a gray "invalid" badge rather than a blank image.
IP badge FAQ
If I embed the badge in a public page, whose IP do others see?
The "visitor IP" and "visitor IP + country" styles show the exit IP of whoever is viewing, so every visitor sees their own address, not yours. If you want everyone to see the same IP, use "A specific IP + country".
Can I use it in a GitHub README?
Yes, copy the Markdown code. But GitHub fetches and caches images through its own image servers, so a visitor-IP badge usually shows that server's exit address, not the reader's IP. In a README, a specific-IP badge is the better fit because the address and country are fixed.
How do I show the country name or change the color?
Add a language segment and a color segment at the end of the address: check-ip-en shows "US United States", check-ip-en-blue also sets blue, and the color can be 6 hex digits, such as check-8.8.8.8-ja-ff0000. Supported languages are zh, zht, en, ja, ru, fa and tr; with no language only the two-letter code shows. The generator above lets you click instead of typing.
How long are badges cached, and how often does the data update?
Visitor-IP badges are generated for each request and are not HTTP-cached. Badges for a specific IP may be cached by browsers and CDNs for 1 hour, or 1 minute when no country is found. Country results are stored once per IP in our database, so existing results do not consume data-provider allowance again.
Do you log who views a badge?
We do not store badge-viewer identities, view counts, or per-request viewing history, and nothing is linked to an account. To display a visitor IP, the server reads the request source address. Country results are stored once per IP; the IP is sent to IP2Location.io and ipapi.is only on a database miss. A specific-IP badge already exposes that IP in its image URL.
Why does the country show --, and how accurate is it?
Common reasons: the IP is private or reserved; neither the database nor the data service has a country; or the daily allowance for new IPs is used up. Existing database results are unaffected by the allowance. Country location is an estimate and may be wrong for mobile networks, VPNs, or data centers.
More free tools
Need an IP in a specific country?
AnboVPN offers dedicated IPs in many regions, and shared IPs billed by data. Compare the options and pick the location you need.