Neurofibromatosis is caused by mutations in specific genes. NF1 is caused by a mutation in the NF1 gene on chromosome 17, while NF2 is caused by a mutation in the NF2 gene on chromosome 22. These mutations can be inherited from a parent or occur spontaneously.