I've heard him being accused of this and read some quotes that sound racist by him and Engels, and I was wondering if there was any validity to this.
edit: spelling
The problem really is the time period, as there wasn't a concept of "racism" in the 19th century. (Oxford dictionary cites "racialism" as the first use in the early 1900s.) Basically, from what I've read, Marx uses the word "nigger" as a descriptive term, and there is little concept for a kind of supremacy of whites over blacks. He often supports black people while using the word, so this is clearly not damning evidence of a racist Karl Marx.
Mr Johnson’s policy is less and less to my liking, too. Nigger-hatred is coming out more and more violently, and he is relinquishing all his power vis-à-vis the old lords in the South. If this should continue, all the old secessionist scoundrels will be in Congress in Washington in 6 months time. Without coloured suffrage nothing can be done, and Johnson is leaving it up to the defeated, the ex-slaveowners, to decide on that. It is absurd. Nevertheless, one must still reckon on things turning out differently from what these barons imagined. After all, the majority of them have been completely ruined and will be glad to sell land to immigrants and speculators from the North. The latter will arrive soon enough and make a good number of changes. I think the mean whites will gradually die out. Nothing more will become of this race; those who are left after 2 generations will merge with the immigrants to make a completely different race.
The niggers will probably turn into small squatters as in Jamaica. Thus ultimately the oligarchy will go to pot after all, but the process could be accomplished immediately at one fell swoop, whereas it is now being drawn out.
Source: http://www.marxists.org/archive/marx/works/1865/letters/65_07_15.htm
As far as I understand it, many who campaigned for black rights in the 19th century, including Lincoln, did not desire full equality between the races. Accusing someone of racism from the 19th century is anachronistic, and it is better to evaluate someone by their actions and ideas towards black people at the time, rather to take a modern perspective.