How Many Countries Are There?
This post is presented in the LLM-Lensed Iterative Blogging format: a hand-written summary by me first, then a full version generated by an LLM from that summary.
Summary
Written by hand.
Disclaimer: This post is intended to be a fun new approach to an old question and an exposition of some very general math. This is not to be seen as a subjective endorsement of the legitimacy or illegitimacy of any governing bodies.
How many countries are there? It depends on who you ask. The UN gives a popular number, but doesn't capture the list of countries exactly. Every person and every country has their own set of countries they recognize.
What about an average of everyone's view? This promises a real number value for the total that could be more representative than any individual count. However, it's infeasible to collect every person's count. (This could be estimated statistically, but we don't do that here). Uniformly averaging over countries doesn't work either; it seems unintuitive to count every country's opinion equally, but also, it requires already having a list of countries!
We want a weighted average of countries' country count, which requires a country-ness for each country which should be a (country-wise) weighted average of countries' opinions of country-ness, which requires a country-ness for each country which should be... and so on.
This apparent infinite regress is exactly the domain where Google's original PageRank algorithm is applicable! We find a fixed point that properly weights the importance of nodes by the importance suggested by neighbors, weighted by their importance.
Agent instructions
Find a large overestimation of the list of countries, including micronations like Sealand.
Find a list of diplomatic relationships for each country and make informed inferences if this data isn't available.
Run the PageRank algorithm on this digraph to obtain the country-ness of every country on this long list.
Report the per-country country-ness and total (i.e. real country count) up front for readers who are already familiar with the methodology. The country-ness table should be collapsible.
The meat of the blog should be a motivation and exposition of linear algebra generally and PageRank specifically, noting that this application exhibits the broad diversity of linear algebra's utility.
Generated by claude-opus-4-8
The text below is AI-generated from the summary above.
Here is the answer, for the impatient: by this method there are about 199 countries. The precise figure the computation returns is 198.72, which is a comically exact number for a quantity that has no business being exact — and that tension is the whole point. Every entity below is assigned a country-ness between 0 and 1: a 1 is a state that essentially everyone recognizes, a 0 is a claim that essentially no one honors, and the interesting cases live in between. The “real country count” is nothing more than the sum of that column. Unlike a first draft of this post, the recognition figures below are pulled from actual diplomatic sources (listed at the end), not guessed.
A few of the entries that make the case for a fractional count:
| Entity | Country-ness |
|---|---|
| United States, France, India, … (fully recognized) | 1.000 |
| China | 0.951 |
| Vatican City (Holy See) | 0.932 |
| Israel | 0.873 |
| Palestine | 0.820 |
| Kosovo | 0.614 |
| Western Sahara (SADR) | 0.296 |
| Taiwan (ROC) | 0.189 |
| Somaliland | 0.141 |
| Sealand (and every other micronation) | 0.137 |
Full country-ness table (217 entities)
Recognition counts are sourced (see the end of the post); for a state recognized by many members, an arbitrary set of that many UN members stands in as the recognizers, since in the near-complete UN clique the result depends on the count, not on which members. Figures are as of mid-2026.
| Entity | Country-ness |
|---|---|
| Albania | 1.000 |
| Andorra | 1.000 |
| Angola | 1.000 |
| Antigua and Barbuda | 1.000 |
| Argentina | 1.000 |
| Australia | 1.000 |
| Austria | 1.000 |
| Azerbaijan | 1.000 |
| Bahamas | 1.000 |
| Bahrain | 1.000 |
| Barbados | 1.000 |
| Belarus | 1.000 |
| Belgium | 1.000 |
| Belize | 1.000 |
| Benin | 1.000 |
| Bolivia | 1.000 |
| Bosnia and Herzegovina | 1.000 |
| Botswana | 1.000 |
| Brazil | 1.000 |
| Bulgaria | 1.000 |
| Burkina Faso | 1.000 |
| Burundi | 1.000 |
| Algeria | 1.000 |
| Bangladesh | 1.000 |
| Bhutan | 1.000 |
| Cabo Verde | 1.000 |
| Cambodia | 1.000 |
| Cameroon | 1.000 |
| Canada | 1.000 |
| Central African Republic | 1.000 |
| Chad | 1.000 |
| Chile | 1.000 |
| Colombia | 1.000 |
| Afghanistan | 1.000 |
| Brunei | 1.000 |
| Congo (DRC) | 1.000 |
| Congo (Republic) | 1.000 |
| Costa Rica | 1.000 |
| Cote d'Ivoire | 1.000 |
| Croatia | 1.000 |
| Cyprus | 1.000 |
| Czechia | 1.000 |
| Denmark | 1.000 |
| Dominica | 1.000 |
| Dominican Republic | 1.000 |
| Ecuador | 1.000 |
| Egypt | 1.000 |
| El Salvador | 1.000 |
| Equatorial Guinea | 1.000 |
| Eritrea | 1.000 |
| Estonia | 1.000 |
| Eswatini | 1.000 |
| Ethiopia | 1.000 |
| Fiji | 1.000 |
| Finland | 1.000 |
| France | 1.000 |
| Gabon | 1.000 |
| Gambia | 1.000 |
| Georgia | 1.000 |
| Germany | 1.000 |
| Nauru | 1.000 |
| Nicaragua | 1.000 |
| Russia | 1.000 |
| Cuba | 1.000 |
| Djibouti | 1.000 |
| Ghana | 1.000 |
| Greece | 1.000 |
| Grenada | 1.000 |
| Guatemala | 1.000 |
| Guinea | 1.000 |
| Guinea-Bissau | 1.000 |
| Guyana | 1.000 |
| Haiti | 1.000 |
| Honduras | 1.000 |
| Hungary | 1.000 |
| Iceland | 1.000 |
| India | 1.000 |
| Ireland | 1.000 |
| Italy | 1.000 |
| Jamaica | 1.000 |
| Japan | 1.000 |
| Jordan | 1.000 |
| Kazakhstan | 1.000 |
| Kenya | 1.000 |
| Kiribati | 1.000 |
| Kyrgyzstan | 1.000 |
| Latvia | 1.000 |
| Lesotho | 1.000 |
| Liberia | 1.000 |
| Liechtenstein | 1.000 |
| Lithuania | 1.000 |
| Luxembourg | 1.000 |
| Madagascar | 1.000 |
| Malawi | 1.000 |
| Malta | 1.000 |
| Marshall Islands | 1.000 |
| Mauritius | 1.000 |
| Mexico | 1.000 |
| Comoros | 1.000 |
| Indonesia | 1.000 |
| Iran | 1.000 |
| Iraq | 1.000 |
| Kuwait | 1.000 |
| Laos | 1.000 |
| Lebanon | 1.000 |
| Libya | 1.000 |
| Malaysia | 1.000 |
| Mali | 1.000 |
| Mauritania | 1.000 |
| Micronesia | 1.000 |
| Moldova | 1.000 |
| Monaco | 1.000 |
| Mongolia | 1.000 |
| Montenegro | 1.000 |
| Morocco | 1.000 |
| Mozambique | 1.000 |
| Myanmar | 1.000 |
| Namibia | 1.000 |
| Nepal | 1.000 |
| Netherlands | 1.000 |
| New Zealand | 1.000 |
| Nigeria | 1.000 |
| North Macedonia | 1.000 |
| Norway | 1.000 |
| Palau | 1.000 |
| Panama | 1.000 |
| Papua New Guinea | 1.000 |
| Paraguay | 1.000 |
| Peru | 1.000 |
| Philippines | 1.000 |
| Poland | 1.000 |
| Portugal | 1.000 |
| Romania | 1.000 |
| Rwanda | 1.000 |
| Saint Kitts and Nevis | 1.000 |
| Saint Lucia | 1.000 |
| Saint Vincent and the Grenadines | 1.000 |
| Samoa | 1.000 |
| San Marino | 1.000 |
| Sao Tome and Principe | 1.000 |
| Senegal | 1.000 |
| Serbia | 1.000 |
| Seychelles | 1.000 |
| Sierra Leone | 1.000 |
| Singapore | 1.000 |
| Slovakia | 1.000 |
| Slovenia | 1.000 |
| Syria | 1.000 |
| Turkey | 1.000 |
| Venezuela | 1.000 |
| Maldives | 1.000 |
| Niger | 1.000 |
| Qatar | 1.000 |
| Solomon Islands | 1.000 |
| South Africa | 1.000 |
| South Sudan | 1.000 |
| Spain | 1.000 |
| Sri Lanka | 1.000 |
| Suriname | 1.000 |
| Sweden | 1.000 |
| Switzerland | 1.000 |
| Tajikistan | 1.000 |
| Tanzania | 1.000 |
| Thailand | 1.000 |
| Timor-Leste | 1.000 |
| Togo | 1.000 |
| Tonga | 1.000 |
| Trinidad and Tobago | 1.000 |
| Turkmenistan | 1.000 |
| Uganda | 1.000 |
| Ukraine | 1.000 |
| United Arab Emirates | 1.000 |
| United Kingdom | 1.000 |
| United States | 1.000 |
| Uruguay | 1.000 |
| Uzbekistan | 1.000 |
| Vanuatu | 1.000 |
| Zambia | 1.000 |
| Zimbabwe | 1.000 |
| Oman | 1.000 |
| Pakistan | 1.000 |
| Saudi Arabia | 1.000 |
| Sudan | 1.000 |
| Tunisia | 1.000 |
| Tuvalu | 1.000 |
| Vietnam | 1.000 |
| Yemen | 1.000 |
| Somalia | 1.000 |
| Armenia | 0.996 |
| North Korea | 0.995 |
| South Korea | 0.995 |
| China | 0.951 |
| Vatican City (Holy See) | 0.932 |
| Israel | 0.873 |
| Palestine | 0.820 |
| Kosovo | 0.614 |
| Cook Islands | 0.418 |
| Western Sahara (SADR) | 0.296 |
| Niue | 0.258 |
| Taiwan (ROC) | 0.189 |
| Abkhazia | 0.160 |
| South Ossetia | 0.160 |
| Northern Cyprus (TRNC) | 0.142 |
| Somaliland | 0.141 |
| Transnistria | 0.139 |
| Christiania | 0.137 |
| Elleore | 0.137 |
| Hutt River | 0.137 |
| Ladonia | 0.137 |
| Liberland | 0.137 |
| Molossia | 0.137 |
| Sealand | 0.137 |
| Seborga | 0.137 |
| Slowjamastan | 0.137 |
| Westarctica | 0.137 |
| Whangamomona | 0.137 |
| Wirtland | 0.137 |
The rest of this post is about where those numbers come from, and it is really an excuse to talk about linear algebra — a subject whose reach is so absurdly wide that “how many countries are there” and “which web page should I show you” turn out to be, underneath, the exact same question.
The circular definition, taken seriously
Start with the paradox from the summary. We wanted to average the world's opinions about which places are countries, but weighted — a great power's recognition should count for more than a hobbyist's. So the weight we assign to each country ought to be its country-ness. But that is the very thing we set out to compute. The definition eats its own tail:
A place is a country to the extent that countries recognize it — where each recognizer's vote is worth its own country-ness.
Read as a procedure, this never terminates. Read as an equation, it is perfectly well posed, and it has a solution. The move from “infinite regress” to “solvable equation” is the single most useful idea in linear algebra, so it is worth slowing down on.
What linear algebra is actually for
Most people meet linear algebra as a bookkeeping system for solving several equations in several unknowns, and leave with the impression that it is the branch of math concerned with grids of numbers. That undersells it enormously. The real subject is linear maps: functions that respect addition and scaling, so that once you know what the map does to a handful of building-block directions, you know what it does to everything. A matrix is just a linear map written down in coordinates.
The reason this one idea shows up everywhere — in quantum mechanics, in the compression of the image you are looking at, in Google's index, in the way a population's age brackets shift year over year, in the least-squares line through a scatterplot — is that an astonishing number of real processes are linear, or close enough that pretending they are is the smartest first move you can make. “Recognition flows from country to country” is one of those processes.
Within the study of a linear map, a few directions are special: the ones the map does not rotate, only stretches or shrinks. If A is the map and it merely scales a nonzero vector v by a factor λ, so that
A v = λv,
then v is an eigenvector and λ its eigenvalue. Eigenvectors are the skeleton of a linear map: the axes along which its behavior is pure scaling and therefore easy to understand. And crucially, an eigenvector is a kind of self-consistent state — a configuration that the process reproduces instead of scrambling. That is exactly what our circular definition is asking for. A vector of country-ness values that the “pass recognition around” operation leaves pointing the same way is a country-ness assignment that is consistent with itself. The snake swallowing its tail is an eigenvector equation in disguise.
PageRank: the same trick, invented for the web
In the late 1990s Larry Page and Sergey Brin faced a structurally identical problem. A web page is important if important pages link to it — another definition that refers to itself. Their PageRank algorithm resolves the circularity by finding the eigenvector, and it is worth seeing the machinery because we are about to point it at countries instead of pages.
Model the world as a directed graph. Each entity is a node; draw an arrow from j to i when j recognizes i. Now imagine a random walker who stands on a country and, at each step, hops to one of the countries that country recognizes, chosen uniformly. Over a long walk, the fraction of time the walker spends parked on a given node is a natural measure of that node's importance — you arrive often precisely when many well-visited nodes point at you. That long-run occupancy is the eigenvector we want.
Write it in coordinates. Let N be the number of nodes and build the transition matrix M, where the entry in row i, column j is 1/dj if j recognizes i (and j hands out its vote equally among the dj places it recognizes), and 0 otherwise. Each column sums to 1, which makes M a stochastic matrix: it shuffles a distribution of “where the walker probably is” into an updated one. The country-ness vector x we are after is the one that update leaves unchanged,
M x = x,
an eigenvector with eigenvalue 1. Two famous wrinkles keep this honest. First, a node that recognizes no one would be a leak where probability drains away; and second, a graph that splits into cliques that never point at each other can have several competing steady states, so the answer would not be unique. Page and Brin patch both at once with a damping factor α (traditionally 0.85): with probability α the walker follows a recognition arrow, and with probability 1 − α it teleports to a node chosen uniformly at random. The equation becomes
x = αM x + (1 − α)/N · 1,
where 1 is the all-ones vector. The teleport term is a small egalitarian breeze blowing through the graph: it guarantees the walker can get from anywhere to anywhere, and the Perron–Frobenius theorem — a jewel of linear algebra about matrices with positive entries — then promises exactly one steady state, with all-positive entries. The circular definition has a unique answer, and it exists.
Better yet, you can compute it by brute honesty: start with any guess, apply the update over and over, and watch it converge. This is power iteration, and it is how the numbers above were produced — a few hundred multiplications of a vector by a matrix, which is to say, a few hundred rounds of every country telling its neighbors how much of a country it currently thinks they are, until nobody changes their mind.
Reading the results
For the actual computation I took a deliberately generous list of 217 entities: the 193 UN members, plus widely-but-not-universally recognized states, the awkward de facto cases, and a healthy pile of micronations down to Sealand and a fellow named Slowjamastan. The recognition counts are the real, sourced ones (collected at the end): UN members recognize one another except where they genuinely don't — the two Koreas, Pakistan's non-recognition of Armenia, and the 29 states that do not recognize Israel — and each contested entity is given its actual number of recognizers. Then I ran the walk and rescaled so a fully-recognized state sits at country-ness 1.
Even the “great powers” are not all pinned at 1. China comes in at 0.951, docked a sliver because its own One-China policy means the eleven states that recognize Taiwan do not recognize the PRC. The Holy See sits at 0.932, and Israel at 0.873 — that last number is the direct, quantified cost of 29 withheld recognitions, and it is exactly the kind of thing the method is good at: turning a diffuse political fact into a scalar.
The richest structure is in the middle. Palestine lands at 0.820 on the strength of 157 recognitions (including the 2024–25 wave that added France, the UK, and Canada), while Kosovo sits at 0.614 on a contested ~110 — heavy fractions of a country that the algorithm refuses to round off. Taiwan is the method's sharpest provocation: a place with its own government, currency, military, and twenty-three million people scores just 0.189, because country-ness here measures recognition and nothing else, and formal recognition is precisely what Taiwan has been squeezed out of. The number is not a judgment about Taiwan; it is a mirror held up to the world's diplomatic bookkeeping.
And then the floor. Everything recognized by no one — Sealand, Molossia, Liberland, the whole micronational bestiary — settles at exactly 0.137, which is not zero but the residue of the teleport term, the little democratic breeze that refuses to let any node vanish entirely. The most striking case sits just above it: Somaliland at 0.141. For thirty years a territory with a functioning government, elections, and its own currency would have been pinned to the micronation floor, mathematically indistinguishable from a gun platform in the North Sea. It lifts off that floor only because, on 26 December 2025, Israel became the first UN member to recognize it — and because Israel is itself only a 0.87-country, that single vote lifts Somaliland less than Turkey's lone vote lifts Northern Cyprus (0.142). One recognition, and you can watch its exact weight in the third decimal place.
Sum the whole column and you get 198.72. It is satisfyingly close to the UN's ~193, and the gap is honest: the fractional recognitions of Palestine, Kosovo, and the rest add up to a handful of extra countries, while the teleport floor sprinkles a little country-ness onto entities that have no real claim to it. Notably, this number is almost unchanged from a first draft of this post built on guessed recognition data — the headline is robust even though individual rows (Israel, China, Somaliland) moved a lot once real sources went in. Change the damping factor, or next year's recognition counts, and the number drifts — as it should. There was never going to be one integer here.
The point
The honest answer to “how many countries are there” is that the question presumes a sharp boundary the world does not actually have. What the world has instead is a vast web of mutual recognition, and the mathematically natural summary of that web is not a count but a distribution — a country-ness for everyone, self-consistent by construction. That we can extract a single real number from it at all, let alone the same machinery Google used to rank the internet, is a small monument to how far a good linear map will carry you. Somewhere between a hobbyist's flag and a permanent seat on the Security Council, there are about 199 countries.
Sources
Recognition counts as of mid-2026. Where a count is contested or drifts over time, the figure used is noted. Wikipedia's “international recognition” pages are used as aggregators of primary diplomatic sources; official primaries are linked where they anchor a headline number.
- Palestine — 157/193 (Sep 2025, uncontested): International recognition of Palestine; primary: OHCHR press release.
- Kosovo — ~110/193 (Dec 2025, contested: Kosovo claims 120, Serbia 84): International recognition of Kosovo; Reuters (Kenya, 2025).
- Western Sahara / SADR — ~37 active (Nov 2024; 84 historical, many frozen/withdrawn): International recognition of the SADR.
- Taiwan (ROC) — 11 UN members (+ the Holy See; Nauru switched to Beijing Jan 2024): ROC MOFA, Diplomatic Allies.
- Holy See — 184 states with full relations (Jan 2026; not all are UN members): Vatican Press Office informative note.
- Israel — 29 UN members do not recognize it (post-Abraham-Accords): International recognition of Israel.
- Abkhazia & South Ossetia — 5 each (Russia, Nicaragua, Venezuela, Nauru, Syria): International recognition of Abkhazia and South Ossetia.
- Northern Cyprus — 1 (Turkey only; UNSC Res. 541), Transnistria — 0 UN members, Cook Islands — ~65 and Niue — ~28 diplomatic relations: List of states with limited recognition.
- Somaliland — 1 (Israel, first UN member, 26 Dec 2025): Al Jazeera; Israel–Somaliland relations.