  We propose an efficient algorithm for determinising counting automata (CAs),
i.e., finite automata extended with bounded counters. The algorithm avoids
unfolding counters into control states, unlike the na\"ive approach, and thus
produces much smaller deterministic automata. We also develop a simplified and
faster version of the general algorithm for the sub-class of so-called monadic
CAs (MCAs), i.e., CAs with counting loops on character classes, which are
common in practice. Our main motivation is (besides applications in
verification and decision procedures of logics) the application of
deterministic (M)CAs in pattern matching regular expressions with counting,
which are very common in e.g. network traffic processing and log analysis. We
have evaluated our algorithm against practical benchmarks from these
application domains and concluded that compared to the na\"ive approach, our
algorithm is much less prone to explode, produces automata that can be several
orders of magnitude smaller, and is overall faster.
