The examples and perspective in this article deal primarily with the United States and do not represent a worldwide view of the subject. (May 2017) (Learn how and when to remove this template message)
In legal terminology, a complaint is any formal legal document that sets out the facts and legal reasons (see: cause of action) that the filing party or parties (the plaintiff(s)) believes are sufficient to support a claim against the party or parties against whom the claim is brought (the defendant(s)) that entitles the plaintiff(s) to a remedy (either money damages or injunctive relief). For example, the Federal Rules of Civil Procedure (FRCP) that govern civil litigation in United States courts provide that a civil action is commenced with the filing or service of a pleading called a complaint. Civil court rules in states that have incorporated the Federal Rules of Civil Procedure use the same term for the same pleading.
In Civil Law, a "complaint" is the first formal action taken to officially begin a lawsuit. This written document contains the allegations against the defense, the specific laws violated, the facts that led to the dispute, and any demands made by the plaintiff to restore justice.
In some jurisdictions, specific types of criminal cases may also be commenced by the filing of a complaint, also sometimes called a criminal complaint or felony complaint. Most criminal cases are prosecuted in the name of the governmental authority that promulgates criminal statutes and enforces the police power of the state with the goal of seeking criminal sanctions, such as the State (also sometimes called the People) or Crown (in Commonwealth realms). In the United States, the complaint is often associated with misdemeanor criminal charges presented by the prosecutor without the grand jury process. In most U.S. jurisdictions, the charging instrument presented to and authorized by a grand jury is referred to as an indictment.
Virtually every U.S. state has some forms available on the web for most common complaints for lawyers and self-representing litigants; if a petitioner cannot find an appropriate form in their state, they often can modify a form from another state to fit his or her request. Several United States federal courts publish general guidelines for the petitioners and Civil Rights complaint forms.
A complaint generally has the following structural elements:
After the complaint has been filed with the court, it has to be properly served to the opposite parties, but usually petitioners are not allowed to serve the complaint personally. The court also can issue a summons - an official summary document which the plaintiff needs to have served together with the complaint. The defendants have limited time to respond, depending on the State or Federal rules. A defendant's failure to answer a complaint can result in a default judgment in favor of the petitioner.
For example, in United States federal courts, any person who is at least 18 years old and not a party may serve a summons and complaint in a civil case. The defendant must submit an answer within 21 days after being served with the summons and complaint, or request a waiver, according to FRCP Rule 12. After the civil complaint has been served to the defendants, the plaintiff must, as soon as practicable initiate a conference between the parties to plan for the rest of the discovery process and then the parties should submit a proposed discovery plan to the judge within 14 days after the conference.
In many U.S. jurisdictions, a complaint submitted to a court must be accompanied by a Case Information Statement, which sets forth specific key information about the case and the lawyers representing the parties. This allows the judge to make determinations about which deadlines to set for different phases of the case, as it moves through the court system.
There are also freely accessible web search engines to assist parties in finding court decisions that can be cited in the complaint as an example or analogy to resolve similar questions of law. Google Scholar is the biggest database of full text state and federal courts decisions that can be accessed without charge. These web search engines often allow one to select specific state courts to search.
Federal courts created the Public Access to Court Electronic Records (PACER) system to obtain case and docket information from the United States district courts, United States courts of appeals, and United States bankruptcy courts. The system is managed by the Administrative Office of the United States Courts; it allows lawyers and self-represented clients to obtain documents entered in the case much faster than regular mail.
In addition to Federal Rules of Civil Procedure, many of the U.S. district courts have developed their own requirements included in Local Rules for filing with the Court. Local Rules can set up a limit on the number of pages, establish deadlines for motions and responses, explain whether it is acceptable to combine a motion petition with a response, specify if a judge needs an additional copy of the documents (called "judge's copy"), etc. Local Rules can define page layout elements like: margins, text font/size, distance between lines, mandatory footer text, page numbering, and provide directions on how the pages need to be bound together - i.e. acceptable fasteners, number and location of fastening holes, etc. If the filed motion does not comply with the Local Rules then the judge can choose to strike the motion completely, or order the party to re-file its motion, or grant a special exception to the Local Rules.
According to Federal Rules of Civil Procedure (FRCP) 5.2, sensitive text like Social Security number, Taxpayer Identification Number, birthday, bank accounts and children's names, should be redacted from the filings made with the court and accompanying exhibits, (however, exhibits normally do not need to be attached to the original complaint, but should be presented to Court after the discovery). The redacted text can be erased with black-out or white-out, and the page should have an indication that it was redacted - most often by stamping word "redacted" on the bottom. Alternately, the filing party may ask the court's permission to file some exhibits completely under seal. A minor's name of the petitions should be replaced with initials.
A person making a redacted filing can file an unredacted copy under seal, or the Court can choose to order later that an additional filing be made under seal without redaction. Copies of both redacted and unredacted documents filed with court should be provided to the other parties in the case. Some courts also require that an additional electronic courtesy copy be emailed to the other parties.
Before filing the complaint, it is important for plaintiff(s) to remember that Federal courts can impose liability for the prevailing party's attorney fees to the losing party, if the judge considers the case frivolous or for purposes of harassment, even when the case was voluntarily dismissed. In the case of Fox v. Vice, the U.S. Supreme Court held that reasonable attorneys' fees could be awarded to the defendant under 42 U.S.C. Sec. 1988, but only for costs that the defendant would not have incurred "but for the frivolous claims."  Even when there is no actual trial or judgment, if there is only pre-trial motion practice such as motions to dismiss, attorney fee shifting still can be awarded under FRCP Rule 11 when the opposing party files a Motion for Sanctions and the court issue an order identifying the sanctioned conduct and the basis for the sanction. The losing party has a right to appeal any order for sanctions in the higher court. In the state courts, however, each party is generally responsible only for its own attorney fees, with certain exceptions.