King (chess)

The king (♔, ♚) is the most important piece in the game of chess. In algebraic notation, the king is abbreviated in English by the letter "K". If a player's king is threatened with capture, it is said to be "in check", and the player must remove the threat of on the next move. If this cannot be done, the king is said to be in checkmate, resulting in a loss for that player. Players cannot make any move that places their own king in check. Although the king is the most important piece, it is one of the weakest pieces in the game outside of the endgame.
Each player begins the game with a king of their color. The white king starts the game on e1; the black king starts on e8. Unlike the other pieces, only one king per player can be on the board at any time, and the kings are never removed from the board during the game. 
Placement and movement.
White starts with the king on e1, on the first to the right of the queen. Black starts with the king on e8, directly across from the white king. The kings always start on a square of opposite color.
A king can move one square in any direction (horizontally, vertically, or diagonally), unless the square is already occupied by a friendly piece, or the move would place the king in check. As a result, opposing kings may never occupy adjacent squares (see opposition) to give check, as that would put the moving king in check as well. However, the king can give discovered check by unblocking a bishop, rook, or queen. The king is also involved in the special move of castling. 
Castling.
The king can make a special move, in conjunction with a rook, called "castling". When castling, the king moves two squares toward one of its rooks, and that rook is placed on the square over which the king crossed. 
Castling is permissible only when:
Castling with the h-file rook is known as "castling kingside" or "short castling" (denoted 0-0 in algebraic notation), while castling with the a-file rook is known as "castling queenside" or "long castling" (denoted 0-0-0).
Status in games.
Check and checkmate.
A king that is under attack is said to be "in check", and the player in check must immediately remedy the situation. There are three possible ways to remove the king from check:
If none of the three options are available, the player's king has been "checkmated" and the player loses the game.
Stalemate.
A stalemate occurs when a player, on their turn, has no legal moves, and the player's king is not in check.
If this happens, the king is said to have been stalemated and the game ends in a draw. A player who has very little or no chance of winning will often, in order to avoid a loss, try to entice the opponent to inadvertently place the player's king in stalemate (see swindle).
Role in gameplay.
In the opening and middlegame, the king will rarely play an active role in the development of an offensive or defensive position. Instead, a player will normally try to castle and seek safety on the edge of the board behind friendly pawns. In the endgame, however, the king emerges to play an active role as an offensive piece as well as assisting in the promotion of their remaining pawns.
It is not meaningful to assign a value to the king relative to the other pieces, as it cannot be captured or exchanged, and must be protected at all costs. In this sense, its value could be considered infinite. As an assessment of the king's capability as an offensive piece in the endgame, it is often considered to be slightly stronger than a bishop or knight – Emanuel Lasker gave it the value of a knight plus a pawn (i.e. four points on the scale of chess piece relative value) . It is better at defending nearby pawns than the knight is, and it is better at attacking them than the bishop is .
Unicode.
Unicode defines two codepoints for king:
♔ U+2654 White Chess King (HTML &#9812;)
♚ U+265A Black Chess King (HTML &#9818;)