Try
\text{a\^{}b}
in KaTeX vs LaTeX. In the latter \^{} is a proper caret character, whereas in the former.. well, I'm not quite sure what's going on, maybe it's only a spacing issue, but the result certainly looks wrong.
(Replacing \text with \texttt may help see the problem)
Interesting, thanks for spotting. I need to understand when accented characters take the width of the accent (perhaps empty base character is a special case?) and when they take the width of the base character (as in \^\i).
any progress on this?
@edemaine it looks like it's a text mode thing. Here's what quicklatex.com produces:
\text{a^{}b}

a^{}b

The second one is actual an error. I didn't notice it at first because quicklatex.com doesn't enable error reporting by default.
I hadn't realized that Sorry, I misspoke.\^ is equivalent to \textasciicircum. I'll make a quick PR!
\^ is a text-mode accent command. The issue is with accent commands having empty arguments. In KaTeX, a blank argument is treated like a zero-width box, so the accent gets centered on top. In LaTeX, a blank argument seems to behave the same as something like a space, but I'm not sure by what mechanism it does so (minimum width? special case of {} argument?). Perhaps this is done at the TeX level? Without knowing the mechanism, it's difficult to implement...