The 17-year-old from Bradford, who cannot be named because of his age, was arrested after posting pictures of a homemade explosive device online.
He is on trial at Leeds Crown Court having denied preparing acts of terrorism and making explosives.
Counter terrorism police found the device in his bedroom after being alerted to a series of Snapchat posts.
Live updates on more stories from Yorkshire
Jurors were shown a Facebook conversation about bomb-making during which the defendant, a member of the extreme-rightwing group National Action, told another teenager: "I make miniature pipe bombs."
Barnaby Jameson, prosecuting, asked where the knowledge about pipe bomb components come from.
"Not sure. I guess I've always understood how to make one," the boy said.
He said he had "no idea" when he first learned but it would have been prior to 2016.
He might have gained it after having "seen it in a movie or something", he added.
The jury has previously been shown evidence the boy searched online for how to make a pipe bomb.
The defendant also faced questions about knowledge he appeared to display during the conversations about other kinds of explosive devices.
Mr Jameson asked: "How did you come to know about the construction of a nail bomb?"
"I just put two and two together," the boy said.
"How did you find out about a fertiliser bomb?"
"No idea," he replied.
Referring to a Snapchat post that appeared to threaten Muslims, Mr Jameson said: "It looks as if there's going to be an imminent attack on a specific group of people in Bradford."
The defendant agreed, but said "I don't know" when asked if he was surprised police were alerted
Later, the jury was shown a clip of the defendant engaging in a video chat on the social media site Omegle.
In the clip, the defendant - seen wearing a Nazi uniform - swiftly ends a conversation with the other person, a black man, before using a racially derogatory term and singing "time for the race war, time for the race war".
The defendant laughed in court when the video was played.
The boy said he did not know what he had meant when using the term "race war" and denied ending the conservation because of the other user's skin colour.
The trial continues.
A teenage terror suspect has told a court he is "not sure" where he learned to make a pipe bomb.