A guitar and a violin are both in the stringed instruments family but in different categories. The guitar is under the plucking category while the violin is in the bowed category. You can play the guitar by plucking or strumming the strings while pressing down notes on the fretboard. Generally, you need a bow to play the violin but there are song pieces where plucking is also done.
The violin may be smaller than a guitar but it is louder than it because its resonating chamber is smaller. The guitar can be played with accompaniment and melody while the violin is best as a featured solo instrument in an orchestra setting as it plays melodic lines.
There are several critical differences between a guitar and a violin. The guitar is scale length. It is between 24 and 26 inches, but this will vary slightly between varied brands and styles of guitars. A violin has a much shorter scale length of 12.8 inches. The strings on the violin are about one half as long as the strings on a guitar. The violin is a much smaller instrument. A guitar has frets.
A violin has no frets, and this makes a tremendous difference in the tonal qualities of the instruments. A guitar has six strings. A standard violin has four strings. Also, typically, a violin is played by drawing a bow across the strings to create a long, ringing single note. Guitars are usually strummed or picked.