The usability of the NGS technologies heavily relies on the accuracy of the data. Many research groups developed different programs to clean the sequenced raw data by removing adapter contamination and trimming low-quality nucleotides. However, they are not optimized to process data from any specific equipment. In this study, we present an optimized pipeline Fastq_clean to clean the DNA-seq and RNA-seq data from the illumina sequencer. Fastq_clean can remove the low quality nucleotides and adapter contamination precisely and keep as many of the qualified nucleotides as possible. Fastq_clean can batchly process sequenced data and export statistics information for the data quality control (QC) by running a single command line. Compared with two most used tools on a published dataset, Fastq_clean reached the best performance. Fastq_clean has already been successfully used in some genome or transcriptome projects and it can also be used to clean the NGS data from other sequencers (e.g. 454), but needs some modification to reach the rest performance.