Kantian Ethics
Kantian ethics is deontological, focusing on the action and is built on the categorical and hypothetical imperatives. The hypothetical imperative is not a rule that applies to everyone, only a certain group trying to reach a certain goal, for example, 'If you want to be good at something, you must practice', the key word to create this maxim is 'if'. On the other hand, a categorical imperative is a moral command and tell everyone what to do. According to Kant these apply to everyone because they are based on an 'objective reason of law', for example 'do not steal, do not kill'. Continuing from this idea of a categorical imperative, Kant created the First Formulation which states 'act only to that maxim, whereby you can and at the same time will that it should become a universal law', this means that you should only perform a certain action if it is possible to imagine a world where everyone did this, the contradiction in conception and whether one would want to live in a world where everyone did this, called the contradiction of will. The contradiction of conception says the action is moral if a world can function where this is universal law and the contradiction of will says the action is moral if you would wish to live in a world where this action is universal law. For example, taking the maxim alone from 'a poor mother steals milk from a shop to feed for child' would mean that stealing for any purpose, from whomever and where ever is moral, we ignore the reason as Kant focused on the action and the action alone. In this example, one would not want to live in world where stealing was moral, nor could society function if it was morally correct.
Definitions
Imperative : a command
Catergorical : unconditional
Hypothetical : conditional
Maxim : the action of the situation
End : a goal
Means : a tool to reach a goal

Kantian Ethics Applied
Using Kantian ethics, we can decide whether or not the death penalty is morally right and good. Kant would only take into account the action of the death penalty which is murder, and from this we can see that it goes against the contradiction of conception, because in a society where murder is moral, there will be chaos. This also goes against the contradiction of will, because everyone would agree that they would not wish to live in a society where murder was correct. However this can be contradicted because using the same logic, what the criminal did was morally wrong. If Kantian ethics focused on the whole situation and not just the maxim, 'punishing a criminal with a punishment suitable for the crime' and not just 'punishment', it could be argued that the death penalty is moral, although a counter argument would be whether the death penalty is a suitable punishment for a certain crime, and the underlying fact that it only focuses on the maxim of the action. Kant's Second Formulation is to treat everyone as a means and an end, meaning that all party should gain from a certain action in which they are involved, and that neither party is forced into the situation. In the situation of punishing a criminal with the death penalty, the certain parties are the criminal, the executioner, and the judge sentencing the criminal. The judge wants the criminal to be punished and for there not to be any injustice, and in this situation is using the criminal and their execution as a means or tool to reach this end point. The executioner is being used as a means by the justice system to reach an end goal of justice, however they are also being treated as an end become they are not being forced to do this, they chose the job, and they gain from the execution, because they are paid. The only party in this situation who is forced and treated as a means to and end is the criminal themselves. Overall Kant and his ethics views and formulation disagrees with the death penalty, and when Kantian ethics is applied, the death penalty is morally wrong because it goes against the first and second formulations. Kantian Ethics disagrees with the death penalty.