Omar Al-Kutobi, 24, and Mohammad Kiad, 25, were allegedly about to kill or harm a member of the public with a knife as part of a terrorist attack but were arrested at a property in Sydney's west on Tuesday afternoon.
A machete, a hunting knife and an Islamic State flag were allegedly seized from a small, converted garage the men shared in Fairfield.
A video which allegedly shows one of the men vowing an attack in the name of IS was also found.
NSW Police Deputy Commissioner Catherine Burn said authorities acted on intelligence Al-Kutobi and Kiad were in the final hours of preparing an attack.
The Nine Network reported that Sydney police were the target of the plot.
The men appeared before Fairfield Local Court on Wednesday and didn't apply for bail, which was formally refused.
They are due to appear at Central Local Court via audio visual link on Thursday.