$\pi$-Base, an online version of the reference chart from Steen and Seebach's Counterexamples in Topology, gives the following examples of compact, non-separable spaces. You can view the search result for more details on these spaces.

Alexandroff Square

Closed Ordinal Space $[0, \Omega]$

Concentric Circles

Either-Or Topology

Lexicographic Ordering on the Unit Square

The Extended Long Line

Tychonoff Plank

Uncountable Excluded Point Topology

Uncountable Fort Space

Uncountable Modified Fort Space


A not so simple, but curious example is the Alexandroff Double Circle:

Consider $C_i=\{(x,y) \in \mathbb{R}^2; x^2+y^2=i\}$ for $i=1,2$. Let $X=C_1 \cup C_2$ and $f:C_1 \to C_2$ the radial homeomorphism. Define a topology on $X$ as follows: the points in $C_2$ are all isolated; for each $x \in C_1$ and $n \in \mathbb{N}$ let $O(x,n)$ the arc in $C_1$ centered at $x$ and with length $\frac{1}{n}$. Now take $B(x,n)=O(x,n) \cup f(O(x,n)-\{x\})$ as open neighborhood. The picture below illustrate such $B(x,n)$.

enter image description here

This way we form a basis for a topology on $X$. $X$ provided with this topology is what we call the Alexandroff Double Circle.

Now, $X$ is not separable because all points in $C_2$ are isolated, hence no countable subset of $C_2$ is dense in $C_2$. For compactness, take an open cover $\{A_{\alpha}\}$ of $X$ which consists of basis neighborhoods. Then it is also an open cover of $C_1$. But notice that the topology of $C_1$ as a subspace of $X$ is exactly the usual one. So it is compact and we can find a finite subcollection $\{A_1,\dots,A_k\} \subset \{A_\alpha\}$ that covers $C_1$. Now, by the nature of our neighborhhods, $X-(A_1\cup \dots \cup A_k)$ is a finite set, so we take an extra $A_{\alpha}$ for each of these points, obtaining a finite subcover.

I don't know if this space is useful some some other things besides counterexamples. This and a lot of other crazy spaces can be found on "Counterexamples in topology", by L. A. Steen and J. A. Seebach.


This I think would be the simplest example. Let $(Y,\tau_d)$ be an uncountable discrete space. Consider the space $X=Y\cup \{x\}$ with topology $\tau=\tau_d \cup \{X\}$. $(X,\tau)$ is clearly compact and, since all points in $Y\subset X$ are isolated, not separable.

The space I described is $\text{T}_0$ but not $\text{T}_1$. @Léo 's answer gives an example of a compact Hausdorff space that is not separable.