Independent Member for Sydney Alex Greenwich says it is "appalling" that a loophole exists in New South Wales law allowing private schools to expel students for being gay.

The state's anti-discrimination laws currently make it a crime to refuse admission to a student or expel a student who is gay, lesbian or transgender.

However private schools and colleges are exempt from the law.

Mr Greenwich is preparing to introduce a Private Member's bill to State Parliament to close the loophole.

"A guy I know who's in a Christian school in western Sydney came out to his headmaster who said to him essentially, 'you know, I can expel you for being gay. I'm not going to do that but don't be open about your homosexuality'," Mr Greenwich said.

"Often these exemptions are not used by the school, but the fact that such a law exists I find that quite appalling and I know many others do as well."

Mr Greenwich is hopeful of getting bipartisan support for his bill, which he plans to introduce in the New South Wales Parliament in August.

"I've found parliament to be quite a gay-friendly place," he said.

"The Attorney-General has previously said that he thought this exemption needed to be looked at, and obviously the Premier and Leader of the Opposition are both supporters of marriage equality and the gay and lesbian community.

"I'm encouraged that the bill should have a good chance of getting through the Upper and Lower House."

The MP says the loophole is unique in New South Wales.