There is no official definition of terrorism agreed on throughout the world, and definitions tend to rely heavily on who is doing the defining and for what purpose. Some definitions focus on terrorist tactics to define the term, while others focus on the actor. Yet others look at the context and ask if it is military or not.
We will probably never arrive at a perfect definition to which we can all agree, although it does have characteristics to which we all point, like violence or its threat. Indeed, the only defining quality of terrorism may be the fact that it invites argument, since the label "terrorism" or "terrorist" arises when there is disagreement over whether an act of violence is justified (and those who justify it label themselves "revolutionaries" or "freedom fighters," etc.). So, in one sense, it may be fair to say that terrorism is exactly violence (or the threat of violence) in context where there will be disagreement over the use of that violence.
But this doesn't mean that no one has tried to define terrorism! In order to prosecute terrorist acts, or distinguish them from war and other violence that is condoned, national and international institutions, as well as others, have sought to define the term. Here are some of the most frequently cited definitions.