There's a bijection $f:\mathbb{R}^n\to [0,1]$ which we can use to induce a metric on $\mathbb{R}^n$ making it compact: $d(x,y)=|f(x)-f(y)|$. Under this definition $f$ becomes a homeomorphism. More generally, the same applies to any set $X$ of cardinality $|\mathbb{R}|$.
On the other hand every compact metric space is separable. And so a compact metric space $X$ is an image of $l(A)=\{(x_n)_{n=1}^\infty\ |\ x_i\in A\}$ for some countable set $A$. Therefore a compact metric space has cardinality of at most $|\mathbb{R}|$. Unlike topological case, where compact spaces can be of arbitrary size.
So is every set of cardinality at most $|\mathbb{R}|$ compact metrizable? Clearly finite (under any metric) and countable sets (bijection with $\{0\}\cup\{1/n\ |\ n\in\mathbb{N}\}$) are. Under the continuum hypothesis there is no other choice. But without the continuum hypothesis? I do not know the answer.