Karzai's signature on the law, which determines how presidential and provincial elections will be run, is expected to alleviate international concerns that the ballot could be delayed or its credibility could be at risk.
His office said Karzai's decree meant the law had come into immediate effect.
Karzai on Wednesday approved a bill giving more power and independence to the electoral complaints watchdog, which was integral to unmasking massive fraud at the last presidential election in 2009.
Afghanistan is due to elect a new president and council members for its 34 provinces on April 5, with Karzai barred from running after serving a maximum two terms.
More From This Section
A corrupt election and a contested result would undermine efforts to establish a functioning state in Afghanistan, where some fear the risk of another civil war as Taliban rebels fight to regain power.
It remains unclear who will run for president.
US-led NATO combat troops, who have supported the Afghan government against a Taliban insurgency, are due to withdraw at the end of 2014, just months after the election.