  A random access code (RAC) is a communication task in which the sender
encodes a random message into a shorter one to be decoded by the receiver so
that a randomly chosen character of the original message is recovered with some
probability. Both the message and the character to be recovered are assumed to
be uniformly distributed. In this paper, we extend this protocol by allowing
more general distributions of these inputs, which alters the encoding and
decoding strategies optimizing the protocol performance, with either classical
or quantum resources. We approach the problem of optimizing the performance of
these biased RACs with both numerical and analytical tools. On the numerical
front, we present algorithms that allow a numerical evaluation of the optimal
performance over both classical and quantum strategies and provide a Python
package designed to implement them, called RAC-tools. We then use this
numerical tool to investigate single-parameter families of biased RACs in the
$n^2 \mapsto 1$ and $2^d \mapsto 1$ scenarios. For RACs in the $n^2 \mapsto 1$
scenario, we derive a general upper bound for the cases in which the inputs are
not correlated, which coincides with the quantum value for $n=2$ and, in some
cases for $n=3$. Moreover, it is shown that attaining this upper bound
self-tests pairs or triples of rank-1 projective measurements, respectively. An
analogous upper bound is derived for the value of RACs in the $2^d \mapsto 1$
scenario, which is shown to be always attainable using mutually unbiased
measurements if the distribution of input strings is unbiased.
