The punishments were announced as players and anti-discrimination groups demand tougher action against incidents at stadiums, including in Italy and Serbia.
"FIFA strongly condemns all forms of racism in football, and any form of discrimination will not be tolerated and will receive a strong response by the relevant FIFA authorities," world football's governing body said in a statement.
FIFA fined Bulgaria 35,000 Swiss francs ($38,000) and Hungary 40,000 Swiss francs ($43,400).
Bulgaria fans made monkey chants at Denmark defender Patrick Mtiliga, who is black, during a World Cup qualifier in Sofia on Oct. 12. Bulgaria, which is in the same group as Italy, will play in an empty stadium on March 22 when it hosts Malta.
"The offensive, denigratory and discriminatory action of a small group of Bulgarian supporters was shameful," FIFA said.
Hungary fans directed anti-Semitic slogans and reportedly displayed Iran flags to insult Israel at an Aug. 15 friendly in Budapest. Hungary's punishment applies to the World Cup when neighbouring Romania visits on March 22.
FIFA's disciplinary panel was "unanimous in condemning an abhorrent episode of racism, anti-Semitism, and of political, provocative and aggressive nature perpetrated by supporters of the Hungarian national team."
However, FIFA declined to take World Cup qualifying points from either team as its disciplinary code allows, and which would have severely damaged the two teams' chances of advancing to the 2014 tournament in Brazil.
Bulgaria and Hungary are in second place in their respective groups, which would be enough to earn a place in the European playoffs in November.
FIFA President Sepp Blatter has said that "sanctions must be a deduction of points or something similar" to uphold the governing body's zero-tolerance stance on racism and discrimination.
Blatter spoke out at the weekend after AC Milan midfielder Kevin-Prince Boateng led teammates to protest at racial abuse by opposing fans by walking off the pitch and force a friendly against fourth-tier Italian club Pro Patria to be abandoned.
At the FIFA player of the year awards on Monday, Blatter said Boateng was "strong and courageous" but that players leaving the field "cannot be the solution in the long term."
FIFA was helped in taking its latest action by the European fans' network FARE, which sends anti-discrimination monitors to high-risk matches.
"We welcome the action taken to enforce a 'closed doors' sanction on Hungary," FARE executive director Piara Powar said in a statement. "Although the punishment does not reflect the action the FIFA president suggested should be imposed last week, it is a strong message for a first offence."
Denmark also complained to FIFA after second-half substitute Mtiliga, whose father is from Tanzania, was abused by Bulgaria fans during the 1-1 draw.
In an unusually detailed published verdict, FIFA said Mtiliga was abused "each time he touched the ball after entering the field in the 54th minute."
"In the 73rd minute, the (FIFA) match commissioner spoke to the 4th official, and a public address warning was given to the home fans by the announcer. Although the level of abuse subsided, audible racist abuse still continued until the final whistle," FIFA said.
Powar said FIFA's verdicts "should be echoed across football."
"The incidents FARE observers reported ... are a reminder of the power that the far-right still have in Europe and the influence they seek over some football fans," he said.
The Bulgarian Football Union was previously fined €40,000 ($52,000) by UEFA for racist abuse by fans directed at England winger Ashley Young in their European Championship qualifier in September 2011.
FIFA has invited fans to report abuse incidents, noting that "any person might report conduct that he or she considers incompatible" with its disciplinary code.
Also on Tuesday, the English Football Association confirmed it would appeal to UEFA against sanctions applied to two of its players after a volatile Under-21 European Championship qualifier in Serbia in November.
UEFA also has filed a challenge to its own independent appeals panel to seek tougher sanctions against Serbia, whose fans aimed monkey chants at England defender Danny Rose. Serbia players and coaches brawled with the English team after the match.
The UEFA disciplinary panel was criticized for fining Serbia just €80,000 ($104,000). Serbia was also ordered to play one U21 match in an empty stadium, plus two coaches and four players were suspended.