The march, organised by Stand Up To Racism, was one of several across the UK on Saturday afternoon, including marches in London and Glasgow.
Organisers said thousands of people across the UK took part in the action against racism, Islamophobia, antisemitism and fascism.
Wales' major anti-racism groups were represented in the march in Cardiff, including Trade Unions Speak Out, Refugees Welcome Here, Justice Now, Black Lives Matter and Resist Racism, as well as politicians from Welsh Labour and Plaid Cymru.
Protesters in Cardiff chanted "refugees are welcome here" and carried signs criticising the UK government’s Illegal Migration Bill.
Some protesters also carried signs in support of Gary Lineker, who was taken off air last week by the BBC for a tweet comparing the language used to launch the Government's asylum seeker policy with 1930s Germany.
The controversial legislation introduced by Home Secretary Suella Braverman last week states that refugees who arrive in the UK through unauthorised means, such as crossing the English Channel in a boat, will have their asylum claims deemed inadmissible.
The First Minister of Wales, Mark Drakeford, has since said that the UK Government's small boats policy is “damaging” the country’s relationship with the rest of the world, accusing it of “dog whistle” politics.
The Cardiff march was organised to mark the UN International Day for the Elimination of Racial Discrimination and the Week of Solidarity with Peoples Struggling against Racism and Racial Discrimination.A Home Office spokesperson said earlier this week: “The UK has a proud history of providing protection for those who genuinely need it through our safe and legal routes offering safety and protection to almost half a million men, women, and children.
“While we are committed to creating more routes to safety for vulnerable people across the globe, we must grip the rise in illegal migration and stop the boats.
“That is why we are introducing new legislation that will see people who come to the UK illegally, liable for detention and swift removal.”
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know