Since the first attempts to quantize gauge theories and gravity in the
loop representation, the problem of the determination of the correspo
nding classical actions has been raised. Here we propose a general pro
cedure to determine these actions and we explicitly apply it to the ca
se of electromagnetism. Going to the lattice we show that the electrom
agnetic action in terms of loops is equivalent to the Wilson action, a
llowing us to do Monte Carlo calculations in a gauge-invariant way. In
the continuum these actions need to be regularized and they are the n
atural candidates to describe the theory in a ''confining phase.''