Wikipedia:Citing sources
Citation types: An inline citation means any citation added close to the material it supports, for example after the sentence or paragraph, normally in the form of a footnote.
In-text attribution involves adding the source of a statement to the article text, such as Rawls argues that X.[5] This is done whenever a writer or speaker should be credited, such as with quotations, close paraphrasing, or statements of opinion or uncertain fact. The in-text attribution does not give full details of the source – this is done in a footnote in the normal way. See In-text attribution below.
A general reference is a citation that supports content, but is not linked to any particular piece of material in the article through an inline citation. General references are usually listed at the end of the article in a References section. They are usually found in underdeveloped articles, especially when all article content is supported by a single source. They may also be listed in more developed articles as a supplement to inline citations.

Short and full citations: A full citation fully identifies a reliable source and, where applicable, the place in that source (such as a page number) where the information in question can be found. For example: Rawls, John. A Theory of Justice. Harvard University Press, 1971, p. 1. This type of citation is usually given as a footnote, and is the most commonly used citation method in Wikipedia articles.
A short citation is an inline citation that identifies the place in a source where specific information can be found, but without giving full details of the source. Some Wikipedia articles use it, giving summary information about the source together with a page number. For example, <ref>Rawls 1971, p. 1.</ref>, which renders as Rawls 1971, p. 1.. These are used together with full citations, which are listed in a separate "References" section or provided in an earlier footnote.
Forms of short citations used include author-date referencing (APA style, Harvard style, or Chicago style), and author-title or author-page referencing (MLA style or Chicago style). As before, the list of footnotes is automatically generated in a "Notes" or "Footnotes" section, which immediately precedes the "References" section containing the full citations to the source. Short citations can be written manually, or by using either the {{sfn}} or {{harvnb}} templates or the {{r}} referencing template. (Note that templates should not be added without consensus to an article that already uses a consistent referencing style.) The short citations and full citations may be linked so that the reader can click on the short note to find full information about the source. See the template documentation for details and solutions to common problems. For variations with and without templates, see wikilinks to full references. For a set of realistic examples, see these.
This is how short citations look in the edit box:

This is how they look in the article:

Shortened notes using titles rather than publication dates would look like this in the article:

When using manual links it is easy to introduce errors such as duplicate anchors and unused references. The script User:Trappist the monk/HarvErrors will show many related errors. Duplicate anchors may be found by using the W3C Markup Validation Service.

When and why to cite sources: By citing sources for Wikipedia content you enable users to verify that the cited information is supported by reliable sources – improving the credibility of Wikipedia while showing that the content is not original research. You also help users find additional information on the subject; and by giving attribution you avoid plagiarising the source of your words or ideas.
In particular, sources are needed for material that is challenged or likely to be challenged. If reliable sources cannot be found for challenged material, it is likely to be removed from the article. Sources are also required when quoting someone, with or without quotation marks, or closely paraphrasing a source. But the need to cite sources is not limited to those situations: editors are always encouraged to add or improve citations for any information in an article.
Citations are especially desirable for statements about living persons, particularly when the statements are contentious or potentially defamatory. In accordance with the biography of living persons policy, unsourced information of this type is likely to be removed on sight.

Multimedia: For an image or other media file, details of its origin and copyright status should appear on its file page. Image captions should be referenced as appropriate just like any other part of the article. A citation is not needed for descriptions such as alt text that are verifiable directly from the image itself, or for text that merely identifies a source (e.g., the caption "Belshazzar's Feast (1635)" for File:Rembrandt-Belsazar.jpg).

When not to cite: Citations are not used on disambiguation pages (sourcing for the information given there should be done in the target articles). Citations are often omitted from the lead section of an article, insofar as the lead summarizes information for which sources are given later in the article, although quotations and controversial statements, particularly if about living persons, should be supported by citations even in the lead. See WP:LEADCITE for more information.

Consecutive cites of the same source: Per WP:PAIC, citations should be placed at the end of the text that they support. Material that is repeated multiple times in a paragraph does not require an inline citation for every mention. If you say an elephant is a mammal more than once, provide one only at the first instance. Avoid cluttering text with redundant citations like this:

Elephants are large[1] land[2] mammals[3] ... Elephants' teeth[4] are very different[4] from those of most other mammals.[3][4] Unlike most mammals,[3] which grow baby teeth[5] and then replace them with a permanent set of adult teeth,[4] elephants have cycles of tooth[5] rotation throughout their entire[6] lives.[4]
This does not apply to lists or tables, nor does it apply when multiple sources support different parts of a paragraph or passage. Citation requirements for WP:DYK may require a citation to be inserted (for the duration of the DYK listing) even within a passage completely cited to the same sources.

Inline citations: Inline citations allow the reader to associate a given piece of material in an article with the specific reliable source(s) that support it. Inline citations are added using footnotes, long or short.

How to place an inline citation using ref tags: To create a footnote, use the <ref>...</ref> syntax at the appropriate place in the article text, for example:

Justice is a human invention.<ref>Rawls, John. ''A Theory of Justice''. Harvard University Press, 1971, p. 1.</ref> It ...
which will be displayed as something like:

Justice is a human invention.[1] It ...
It will also be necessary to generate the list of footnotes (where the citation text is actually displayed); for this, see the previous section.
As in the above example, citation markers are normally placed after adjacent punctuation such as periods (full stops) and commas. For exceptions, see the WP:Manual of Style § Punctuation and footnotes. Note also that no space is added before the citation marker. Citations should not be placed within, or on the same line as, section headings.
The citation should be added close to the material it supports, offering text–source integrity. If a word or phrase is particularly contentious, an inline citation may be added next to that word or phrase within the sentence, but it is usually sufficient to add the citation to the end of the clause, sentence, or paragraph, so long as it's clear which source supports which part of the text.

Avoiding clutter: Inline references can significantly bloat the wikitext in the edit window and can become confusing and difficult to manage. There are two main methods to avoid clutter in the edit window:

Using list-defined references by collecting the full citation code within the reference list template {{reflist}}, and then inserting them in the text with a shortened reference tag, for example <ref name="Smith 2001, p99" />.
Inserting short citations (see below) that then refer to a full list of source texts
As with other citation formats, articles should not undergo large-scale conversion between formats without consensus to do so.
Note, however, that references defined in the reference list template can no longer be edited with the VisualEditor.

Repeated citations: For multiple use of the same inline citation or footnote, you can use the named references feature, choosing a name to identify the inline citation, and typing <ref name="name">text of the citation</ref>. Thereafter, the same named reference may be reused any number of times either before or after the defining use by typing the previous reference name, like this: <ref name="name" />. The use of the slash before the > means that the tag is self-closing, and the </ref> used to close other references must not be used in addition.
The text of the name can be almost anything‍—‌apart from being completely numeric. If spaces are used in the text of the name, the text must be placed within double quotes. Placing all named references within double quotes may be helpful to future editors who do not know that rule.