Michael Steven Sandford, 20, did not enter a plea when he appeared before a judge in Nevada and was remanded in custody until a hearing on 5 July.
He is charged with an act of violence "on restricted grounds".
He had reportedly tried to seize the gun after saying he was seeking Mr Trump's autograph at Saturday's rally.
He said he had been planning to try and shoot Mr Trump for about a year but had decided to act now because he finally felt confident enough to do so, court papers say.
A federal judge found Mr Sandford, who reportedly appeared in court in shackles, to be a danger and risk of non-appearance, and he was ordered detained pending his preliminary hearing. (BBC)