In an 1866 decision, the Supreme Court ruled that the President's pardon power “extends to every offense known to the law, and may be exercised at any time after its commission, either before legal proceedings are taken or during their pendency, or after conviction and judgment.”
In 1974, President Gerald Ford pardoned his predecessor, Richard Nixon (after he had resigned but before he had been charged with any federal crimes), in order to avoid a trial and preserve "tranquility" in the nation. In 1977, President Jimmy Carter pardoned Vietnam War draft dodgers before they had been charged.