A Queens teenager put a note on his cellphone threatening to kill NYPD cops and used Bitcoins to purchase a fake ID, which he then used to buy a gun out of state, authorities charged at his arraignment in Brooklyn federal court Wednesday.

Late last month, FBI agents searched the Richmond Hill home of Ranbir Singh Shergill, 18, and found a loaded Glock 17 handgun and ammunition, court papers say.

Shergill allegedly told the feds that he used the Web site Tor to spend $230 worth of Bitcoins on a fake ID that listed him as a 21-year-old from Ohio. He also admitted to traveling to Ohio to buy the gun, the complaint says.

An undated note on his phone outlined his plans to murder cops, authorities said.

“Do it during a snowstorm . . . Go from dunkin donuts on van wyck after shooting and killing officers they will be wearing coats. And one will be male other female. Then try to kill other nypd officers . . .” the note read, in part.

Shergill was arraigned on charges of transporting a weapon across state lines.

Defense attorney Doug Morris declined to comment.