# page numbers at top right

I've got a simple question, I think. But I can't seem to find the answer to it anywhere. I want page numbers at the top right of each page of my document. How do I do this?

I tried doing:

\documentclass[12pt]{article}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\begin{document}

My text.

\end{document}


While this did result in page numbers being at the top right, I don't like the horizontal lines across the top of each page that this produces.

Use \renewcommand{\headrulewidth}{0pt} for example to set the head rule with to zero -- it won't appear then. The same can be applied to \footrulewidth, if necessary.

\documentclass[12pt]{article}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}