Stroke order

Stroke order is the order in which the strokes of a Chinese character (or Chinese derivative character) are written. A stroke is a movement of a writing instrument on a writing surface. Chinese characters are used in various forms in Chinese, Japanese, Korean and formerly Vietnamese. They are known as "Hanzi" in (Mandarin) Chinese (Traditional form: ; Simplified form: ), "kanji" in Japanese (), "Hanja" in Korean () and "Chữ Hán" in Vietnamese. Stroke order is also attested in other logographic scripts, e.g. cuneiform.
Basic principles.
Chinese characters are basically logograms constructed with strokes. Over the millennia a set of generally agreed rules have been developed by custom. Minor variations exist between countries, but the basic principles remain the same, namely that writing characters should be economical, with the fewest hand movements to write the most strokes possible. This promotes writing speed, accuracy, and readability. This idea is particularly important since as learners progress, characters often get more complex. Since stroke order also aids learning and memorization, students are often taught about it from a very early age in schools and encouraged to follow them. 
The Eight Principles of Yong ( Pinyin: "yǒngzì bā fǎ"; Japanese: "eiji happō"; Korean: , "yeongjapalbeop", "yŏngjap'albŏp") uses the single character , meaning "eternity", to teach eight of the most basic strokes in Regular Script.
Stroke order per style.
Ancient China.
In ancient China, the Jiǎgǔwén characters carved on ox scapula and tortoise plastrons showed no indication of stroke order. The characters show huge variations from piece to piece, sometimes even within one piece. During the divination ceremony, after the cracks were made, the characters were written with a brush on the shell or bone (to be carved in a workshop later). Although the brush-written stroke order is not discernible after carving, there exists some evidence that it was not entirely idiosyncratic: a few of the characters, often marginal administrative notations recording the provenance of the shells or bones, were not later recarved, and the stroke order of these characters tends to resemble traditional and modern stroke order. For those characters (the vast majority) which were later engraved into the hard surface using a knife, perhaps by a separate individual, there is evidence (from incompletely engraved pieces) that in at least some cases all the strokes running one way were carved, then the piece was turned, and strokes running another way were then carved.
Imperial China.
In early Imperial China, the common script was the Xiaozhuan style. About 220 BC, the emperor Qin Shi Huang, the first to conquer all of China, imposed Li Si's character uniformisation, a set of 3300 standardized "Xiǎozhuàn" characters. Its graphs on old steles—some dating from 200 BC—reveal indications of the stroke order of the time. However, stroke order could still not yet be ascertained from the steles, and no paper from that time is extant.
The true starting point of stroke order is the Lìshū style (clerical script) which is more regularized, and in some ways similar to modern text. In theory, by looking at the Lìshū style steles' graphs and the placement of each stroke, one can see hierarchical priority between the strokes, which indicates the stroke order used by the calligrapher or stele sculptors.
Kǎishū style (regular script)—still in use today—is more regularized, allowing one to more easily guess the stroke order used to write on the steles. The stroke order 1000 years ago was similar to that toward the end of Imperial China. For example, the stroke order of is clear in the Kangxi dictionary of 1716; but in a modern book, the official stroke order (the same) will not appear clearly. The Kangxi and current shapes have tiny differences, while current stroke order is still the same, according to the old style. However, the stroke orders implied by the Kangxi dictionary are not necessarily similar to nowadays' norm.
Cursive styles and hand-written styles.
Cursive styles such as "Xíngshū" (semi-cursive or running script) and "Cǎoshū" (cursive or grass script) show stroke order more clearly than Regular Script, as each move made by the writing tool is visible.
Stroke order per polity.
The modern governments of mainland China, Hong Kong, Taiwan, and Japan have standardized official stroke orders to be taught in schools. These stroke order standards are prescribed in conjunction to each government's standard character sets. The various official stroke orders agree on the vast majority of characters, but each have their differences. No governmental standard matches traditional stroke orders completely. The differences between the governmental standards and traditional stroke orders arise from accommodation for schoolchildren who may be overwhelmed if the rules about stroke orders are too detailed, or if there are too many exceptions. The differences listed below are not exhaustive.
Alternative stroke orders.
Besides general errors and regional differences in stroke order, it is common in the PRC to apply alternative stroke orders which resemble PRC stroke orders to Traditional Chinese characters, although the PRC generally uses Simplified characters. In the below example, the traditional character (simplified: ) is shown with both the traditional stroke order (left, starting with the left vertical stroke), as in imperial China, Taiwan, Japan, and Hong Kong, and with the Simplified stroke order (right, with the left vertical stroke fourth).
General guidelines.
"Note: There are exceptions within and among different standards. The following are only guidelines."
1. Write from top to bottom, and left to right. 
As a general rule, strokes are written from top to bottom and left to right. For example, among the first characters usually learned is the number one, which is written with a single horizontal line: . This character has one stroke which is written from left to right.
The character for "two" has two strokes: . In this case, both are written from left to right, but the top stroke is written first. The character for "three" has three strokes: . Each stroke is written from left to right, starting with the uppermost stroke.
This rule also applies to the order of components. For example, can be divided into two. The entire left side () is written before the right side (). There are some exceptions to this rule, mainly occurring when the right side of a character has a lower enclosure (see below).
When there are upper and lower components, the upper components are written first, then the lower components, as in and .
2. Horizontal before vertical 
When horizontal and vertical strokes cross, horizontal strokes are usually written before vertical strokes: the character for "ten", , has two strokes. The horizontal stroke, , is written first, followed by the vertical stroke, to obtain .
In the Japanese standard, a vertical stroke may precede many intersecting horizontal strokes if the vertical stroke does not pass through the lowest horizontal stroke.
3. Character-spanning strokes last 
Vertical strokes that pass through many other strokes are written after the strokes through which they pass, as in and .
Horizontal strokes that pass through many other strokes are written last, as in and .
4. Diagonals right-to-left before diagonals left-to-right 
Right-to-left diagonals () are written before left-to-right diagonals (), as in .
Note that this is for symmetric diagonals; for asymmetric diagonals, as in , the left-to-right may precede the right-to-left, based on other rules.
5. Center before outside in vertically symmetrical characters 
In vertically symmetrical characters, the center components are written before components on the left or right. Components on the left are written before components on the right, as in and .
6. Enclosures before contents 
Outside enclosing components are written before inside components; bottom strokes in the enclosure are written last if present, as in and . (A common mnemonic is "Put people inside first, then close the door.") Enclosures may also have no bottom stroke, as in and .
7. Left vertical before enclosing 
Left vertical strokes are written before enclosing strokes. In the following two examples, the leftmost vertical stroke () is written first, followed by the uppermost and rightmost lines () (which are written as one stroke): and .
8. Bottom enclosures last 
Bottom enclosing components are usually written last: , , .
9. Dots and minor strokes last 
Minor strokes are usually written last, as the small "dot" in the following: , , .
Representations.
There are various ways to describe the stroke order of a character. Children learn the stroke order in courses, as part of writing learning. Various graphical representations are possible, most notably successive images of the character with one more stroke added (or changing color) each time, numbering strokes, color-coding, fanning, and more recently animations. Stroke order is often described in person by writing characters on paper or in the air.